/* payment-modal.css - COMPLETE FILE WITH ALL STYLES */

/* ========== MODAL STRUCTURE ========== */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-modal.hidden {
    display: none;
}

.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.payment-modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(10, 10, 15, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 20px 60px rgba(107, 70, 193, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-modal-content::-webkit-scrollbar {
    width: 8px;
}

.payment-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.payment-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.payment-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* ========== MODAL CLOSE BUTTON ========== */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #b8a7d6;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
    transform: rotate(90deg);
}

/* ========== MODAL HEADER ========== */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header .oracle-symbol {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.modal-header h2 {
    color: #FFD700;
    font-size: 2rem;
    margin: 0 0 10px 0;
}

.modal-subtitle {
    color: #b8a7d6;
    font-size: 1rem;
    margin: 0;
}

/* ========== PACKAGE OPTIONS ========== */
.modal-packages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.package-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
}

.package-option:hover {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.package-option.featured {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(107, 70, 193, 0.15));
}

.package-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFD700;
    color: #0a0a0f;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.package-name {
    color: #e4c4ff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.package-fortune {
    color: #b8a7d6;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Package price display */
.package-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
}

.price-primary {
    color: #FFD700;
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1.2;
}

.price-local {
    color: #b8a7d6;
    font-size: 1.3rem;
    font-weight: 500;
}

.price-hint {
    color: #7a6b9a;
    font-size: 0.85rem;
    font-style: italic;
}

/* ========== PAYMENT FORM ========== */
.modal-payment-form {
    animation: fadeIn 0.3s;
}

.modal-payment-form.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.change-package-btn {
    background: transparent;
    border: none;
    color: #b8a7d6;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.change-package-btn:hover {
    color: #FFD700;
}

/* Selected package display */
.selected-package-info {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.2), rgba(184, 167, 214, 0.1));
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
}

.selected-package-info h3 {
    color: #e4c4ff;
    font-size: 1.4rem;
    margin: 0 0 10px 0;
}

.selected-package-info .fortune {
    color: #b8a7d6;
    font-size: 1.1rem;
    margin: 10px 0;
}

.selected-package-info .price {
    margin: 15px 0;
}

.price-main {
    color: #FFD700;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 6px;
}

.price-usd-reference {
    color: #9a8fb8;
    font-size: 1.1rem;
}

/* Form group */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #b8a7d6;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f5f5f5;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.08);
}

/* Stripe Payment Element Container */
.payment-element-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Payment Errors */
.payment-errors {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    padding: 12px 16px;
    color: #ff6b6b;
    font-size: 0.9rem;
    margin: 15px 0;
}

.payment-errors.hidden {
    display: none;
}

/* Payment Submit Button */
.payment-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FFD700 0%, #b8936d 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.5);
}

.payment-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(10, 10, 15, 0.3);
    border-top-color: #0a0a0f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9a8fb8;
    font-size: 0.85rem;
    margin-top: 15px;
    text-align: center;
}

/* ========== PROCESSING & SUCCESS STATES ========== */
.modal-processing,
.modal-success {
    text-align: center;
    padding: 40px 20px;
}

.modal-processing.hidden,
.modal-success.hidden {
    display: none;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.modal-processing p {
    color: #b8a7d6;
    font-size: 1.1rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.modal-success h3 {
    color: #FFD700;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.modal-success p {
    color: #b8a7d6;
    font-size: 1rem;
    margin-bottom: 20px;
}

.continue-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #FFD700 0%, #b8936d 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* ========== CURRENCY SELECTOR ========== */
.currency-switcher-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: #FFD700;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    margin: 10px auto;
    display: block;
    font-weight: 600;
}

.currency-switcher-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Currency selector bottom sheet */
.currency-selector-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(10, 10, 15, 0.98));
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 30px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    z-index: 999999;
    box-shadow: 0 -10px 40px rgba(107, 70, 193, 0.5);
    max-height: 80vh;
    overflow-y: auto;
    pointer-events: none;  /* Don't intercept clicks when hidden */
}

.currency-selector-sheet.active {
    transform: translateY(0);
    pointer-events: auto;  /* Allow clicks when visible */
}

.currency-selector-header {
    text-align: center;
    margin-bottom: 20px;
}

.currency-selector-header h3 {
    color: #FFD700;
    margin: 0 0 5px 0;
    font-size: 1.3rem;
}

.currency-selector-header p {
    color: #9a8fb8;
    margin: 0;
    font-size: 0.9rem;
}

.currency-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.currency-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.currency-option:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #FFD700;
}

.currency-option.selected {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
}

.currency-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #FFD700;
    cursor: pointer;
}

.currency-option-details {
    flex: 1;
}

.currency-option-primary {
    color: #e4c4ff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.currency-option-label {
    color: #9a8fb8;
    font-size: 0.85rem;
}

.currency-sheet-close {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #b8a7d6;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.currency-sheet-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFD700;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .payment-modal-content {
        padding: 30px 20px;
    }
    
    .price-primary {
        font-size: 1.5rem;
    }
    
    .price-local {
        font-size: 1.1rem;
    }
    
    .price-main {
        font-size: 1.6rem;
    }
    
    .currency-selector-sheet {
        padding: 20px 15px;
    }
}

/* Desktop: Bottom sheet becomes centered modal */
@media (min-width: 769px) {
    .currency-selector-sheet {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        width: 500px;
        max-height: 80vh;
        overflow-y: auto;
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        border-radius: 24px;
    }
    
    .currency-selector-sheet.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}