/* Payment Page Styles */

.payment-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.payment-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(102, 51, 153, 0.12);
}

.payment-section h2 {
    color: var(--brand-purple, #663399);
    font-family: 'Coustard', Georgia, serif;
    font-size: 1.8rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* Service Selection */
.service-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.service-option {
    cursor: pointer;
    position: relative;
}

.service-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.service-card {
    background: #f8f6fc;
    border: 3px solid #e0d6f5;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-row { display: flex; }
.service-card { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }

.service-info { text-align: left; flex: 1; }
.service-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.service-qty label { font-size: 0.9rem; color: #666; }
.qty-input { width: 110px; padding: 10px 12px; border-radius: 10px; border: 1px solid #dcdcec; font-size: 1.25rem; text-align: center; }

.service-option input[type="radio"]:checked + .service-card {
    background: linear-gradient(135deg, #f8f6fc 0%, #e0d6f5 100%);
    border-color: var(--brand-purple, #663399);
    box-shadow: 0 4px 16px rgba(102, 51, 153, 0.2);
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 51, 153, 0.15);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.service-name {
    font-family: 'Coustard', Georgia, serif;
    font-size: 1.2rem;
    color: var(--brand-purple, #663399);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.service-amount {
    font-size: 1.4rem;
    color: #2D3748;
    font-weight: bold;
}

/* Payment Details */
.payment-details-card {
    background: #f8fafd;
    border: 2px solid #e6ecf5;
    border-radius: 12px;
    padding: 1.5rem;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e6ecf5;
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-label {
    font-size: 1.1rem;
    color: #666;
}

.payment-value {
    font-size: 1.2rem;
    color: #2D3748;
    font-weight: 600;
}

/* Ensure numeric values align to the right and have a minimum width for consistent layout */
.payment-row .payment-value {
    min-width: 100px;
    text-align: right;
}

/* Slightly lighter style for the tip row to distinguish from subtotal */
.payment-row:nth-child(3) .payment-label {
    color: #555;
    font-weight: 600;
}

.total-row {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--brand-purple, #663399);
    border-bottom: none;
}

.total-row .payment-label,
.total-row .payment-value {
    font-size: 1.5rem;
    color: var(--brand-purple, #663399);
    font-weight: bold;
}

/* Payment Method Selector */
.payment-method-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.payment-method-btn {
    flex: 1;
    max-width: 250px;
    padding: 1.2rem;
    background: #f8f6fc;
    border: 3px solid #e0d6f5;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: #2D3748;
    transition: all 0.3s ease;
}

.payment-method-btn i {
    font-size: 2rem;
    color: var(--brand-purple, #663399);
}

.payment-method-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 51, 153, 0.15);
}

.payment-method-btn.active {
    background: linear-gradient(135deg, #663399 0%, #8A5AA8 100%);
    border-color: #663399;
    color: white;
}

.payment-method-btn.active i {
    color: white;
}

/* Provider grid for multiple payment buttons */
.payment-providers {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
    width: 100%;
}

.payment-providers .payment-method-btn {
    padding: 1.2rem 1rem;
    min-height: 110px;
    justify-content: center;
    font-size: 1.05rem;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(102,51,153,0.06);
    width: 100%;
    max-width: 420px;
}

.provider-icon {
    font-size: 1.6rem;
}

.provider-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: inherit;
}

/* Service quantity list */
.service-quantity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    border-radius: 10px;
    background: #f8f6fc;
    border: 2px solid #e6ecf5;
}

.service-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.service-qty label { display:block; font-size:1.1rem; color:#333; font-weight:600; }
.service-qty .qty-input { width:120px; padding:10px 12px; border-radius:10px; border:1px solid #ddd; font-size:1.25rem; }

/* Tips */
.tip-row { display:flex; flex-direction:column; gap:0.75rem; align-items:center; }
.tip-buttons { display:flex; gap:0.75rem; flex-wrap:wrap; justify-content:center; }
.tip-btn { padding:1rem 1.25rem; border-radius:12px; border:2px solid #e0d6f5; background:#f8f6fc; cursor:pointer; font-weight:700; font-size:1.05rem; min-width:110px; text-align:center; }
.tip-btn.active { background: linear-gradient(135deg,#663399 0%,#8A5AA8 100%); color:white; border-color:#663399; box-shadow: 0 6px 18px rgba(102,51,153,0.18); }
.tip-btn.tip-none { color:#666; background:transparent; border-color:#d6cfee; text-transform:lowercase; font-weight:600; }
.tip-custom-input { margin-top:0.5rem; }
.tip-custom-input input { padding:8px; border-radius:8px; border:1px solid #ddd; width:160px; }

/* Keep provider list vertical by design to place Venmo at top, PayPal below, Stripe last */
@media (min-width:900px) {
    /* On very wide screens, keep the vertical stack but limit width */
    .payment-providers { align-items: center; }
    /* Larger quantity inputs on desktop */
    .qty-input { width: 160px; font-size: 1.5rem; padding: 14px 16px; }
    .service-qty .qty-input { width: 180px; font-size: 1.6rem; padding: 14px 16px; }
}

@media (max-width:600px) {
    .service-row { flex-direction:row; }
    .tip-buttons { justify-content:center; }
}

/* QR removed - styling cleaned up */

/* Payment Address */
.payment-address-section {
    width: 100%;
    max-width: 600px;
}

.payment-address-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-align: center;
}

.payment-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafd;
    border: 2px solid #e6ecf5;
    border-radius: 8px;
    padding: 1rem;
    word-break: break-all;
}

#address-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2D3748;
}

.copy-btn {
    background: var(--brand-purple, #663399);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #54297a;
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: #38A169;
}

.copy-btn.copied::after {
    content: ' Copied!';
    margin-left: 0.5rem;
}

/* Protocol Info */
.x402-protocol-info {
    width: 100%;
    max-width: 600px;
    background: linear-gradient(135deg, #f8f6fc 0%, #e0d6f5 100%);
    border-radius: 12px;
    padding: 1.5rem;
}

.protocol-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand-purple, #663399);
    margin-bottom: 1rem;
}

.protocol-header i {
    font-size: 1.5rem;
}

.protocol-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.protocol-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: #2D3748;
}

.protocol-features i {
    color: #38A169;
    font-size: 1rem;
}

/* Payment Instructions */
.payment-instructions {
    width: 100%;
    max-width: 600px;
    background: #f8fafd;
    border: 2px solid #e6ecf5;
    border-radius: 12px;
    padding: 1.5rem;
}

.payment-instructions h3 {
    color: var(--brand-purple, #663399);
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    text-align: left;
}

.payment-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
}

.payment-instructions li {
    padding: 0.5rem 0;
    color: #2D3748;
    font-size: 1rem;
    line-height: 1.6;
}

/* Payment Status */
.payment-status {
    width: 100%;
    max-width: 600px;
    background: #fff5e6;
    border: 2px solid #ffd966;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #996600;
    font-size: 1.1rem;
    font-weight: 600;
}

.status-message i {
    font-size: 1.5rem;
}

.status-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--brand-purple, #663399);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.payment-status.success {
    background: #e6f7ee;
    border-color: #38A169;
}

.payment-status.success .status-message {
    color: #1f6f42;
}

.payment-status.success .status-message i {
    color: #38A169;
}

/* Card Payment Section */
.card-payment-form {
    text-align: center;
    padding: 2rem;
}

.info-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #e6f7ff;
    border: 2px solid #91d5ff;
    border-radius: 8px;
    padding: 1rem;
    color: #0050b3;
    font-size: 1.1rem;
}

.info-message i {
    font-size: 1.5rem;
}

/* Hidden State */
.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .payment-section {
        padding: 1.5rem 1rem;
    }

    .service-options {
        grid-template-columns: 1fr;
    }

    .payment-method-selector {
        flex-direction: column;
    }

    .payment-method-btn {
        max-width: 100%;
    }

    /* QR removed */

    .payment-address {
        flex-direction: column;
        gap: 1rem;
    }

    .copy-btn {
        width: 100%;
    }

    .payment-status {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Make qty arrows vertical on mobile; reverse order so top arrow increases */
    .service-qty .qty-control { flex-direction: column-reverse; }
    .qty-btn::before { display:block; }
    .qty-decrease::before { content: '▼'; }
    .qty-increase::before { content: '▲'; }
}

@media (max-width: 480px) {
    .payment-section h2 {
        font-size: 1.4rem;
    }

    .service-card {
        padding: 1rem;
    }

    .service-icon {
        font-size: 2rem;
    }

    .service-name {
        font-size: 1rem;
    }

    .service-amount {
        font-size: 1.1rem;
    }
}

/* Desktop: horizontal arrows */
@media (min-width: 769px) {
    .qty-btn::before { display:inline-block; }
    .qty-decrease::before { content: '◀'; }
    .qty-increase::before { content: '▶'; }
    .service-qty .qty-control { flex-direction: row; }
}

/* Custom qty control: left/right arrow buttons beside the input */
.service-qty .qty-control { display:flex; align-items:center; gap:0.5rem; }
.service-qty .qty-input { width:120px; padding:10px 12px; border-radius:8px; border:1px solid #ddd; font-size:1.25rem; text-align:center; }
.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid #e0d6f5;
    background: #f8f6fc;
    color: var(--brand-purple, #663399);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}
.qty-btn:hover { transform: translateY(-2px); background: linear-gradient(135deg,#f3eff8 0%,#e9e0f6 100%); }
.qty-btn:active { transform: translateY(0); }
.qty-btn:focus { outline: 3px solid rgba(102,51,153,0.12); }

@media (min-width:900px) {
    .qty-btn { width:70px; height:70px; font-size:1.6rem; border-radius:12px; }
    .service-qty .qty-input { width:160px; font-size:1.5rem; padding:14px 16px; }
}

/* hide native number input spinners for a cleaner custom control */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
