/* ========== AUTH MODALS ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--glow);
    animation: slideUp 0.4s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-form-group input {
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.auth-btn {
    padding: 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    text-align: center;
    color: var(--text-secondary);
    margin: 1rem 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ========== USER MENU ========== */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-plan {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.user-plan.pro {
    color: var(--primary);
}

.user-plan.premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--glow);
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.user-dropdown-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.user-dropdown-header h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-dropdown-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.usage-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.usage-label {
    color: var(--text-secondary);
}

.usage-value {
    color: var(--text-primary);
    font-weight: 600;
}

.usage-value.unlimited {
    color: var(--success);
}

.dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.dropdown-btn {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.dropdown-btn i {
    color: var(--primary);
}

.dropdown-btn.logout {
    color: var(--danger);
}

.dropdown-btn.logout i {
    color: var(--danger);
}

/* ========== PRICING CARDS ========== */
.pricing-section {
    max-width: 1200px;
    margin: 3rem auto;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.pricing-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pricing-card:hover {
    border-color: var(--primary);
    box-shadow: var(--glow);
    transform: translateY(-5px);
}

.pricing-card:hover::before {
    opacity: 1;
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--glow);
}

.pricing-card.featured::before {
    opacity: 1;
}

.pricing-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.35rem 0.875rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
}

.pricing-plan {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.pricing-price small {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.pricing-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pricing-features li i {
    color: var(--success);
    font-size: 1.1rem;
}

.pricing-features li.disabled {
    opacity: 0.4;
}

.pricing-features li.disabled i {
    color: var(--text-secondary);
}

.pricing-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pricing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.4);
}

.pricing-btn.outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.pricing-btn.outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 102, 255, 0.05);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== PRICING MODAL FIX ========== */
#pricingModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    max-width: 1000px;
}

#pricingModal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#pricingModal .modal-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

#pricingModal .modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

#pricingModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* ========== RESPONSIVE AUTH MODALS ========== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 2rem;
        margin: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-header p {
        font-size: 0.875rem;
    }
    
    #pricingModal .modal-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .pricing-grid {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
    }
    
    .modal-header {
        margin-bottom: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .auth-form {
        gap: 1rem;
    }
    
    .auth-form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .auth-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .auth-divider {
        margin: 1rem 0;
    }
    
    .social-login {
        gap: 0.75rem;
    }
    
    .social-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}
