/* ==================== PREMIUM DESIGN SYSTEM V3 ==================== */
:root {
    /* Color Palette - Deep Galactic & Neon Accents */
    --bg-main: #010409; /* Deeper Black-Navy for better contrast */
    --bg-secondary: #0d1117; 
    --bg-card: #161b22; 
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-heavy: rgba(1, 4, 9, 0.85); /* Darker glass for better readability */
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(139, 92, 246, 0.5);
    
    --text-primary: #ffffff; /* pure white */
    --text-secondary: #cbd5e1; /* Lighter slate for better reading */
    --text-muted: #94a3b8;
    
    --accent-primary: #a855f7; /* Brighter Purple */
    --accent-secondary: #22d3ee; /* Brighter Cyan */
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #06b6d4 100%);
    --accent-glow: rgba(139, 92, 246, 0.4);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --glow-violet: 0 0 30px rgba(139, 92, 246, 0.25);
}

body.dark-theme {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body.dark-theme::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--accent-glow) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Added for readability on light gradients */
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-primary);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Navigation - Floating High-End Glass */
.navbar {
    background: transparent;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    transition: var(--transition);
}

.nav-container {
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 2rem;
    max-width: 1100px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo .nav-icon {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

.brand-logo .logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
    transition: var(--transition);
}

.brand-logo .logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.8));
}

.brand-logo .highlight {
    color: var(--accent-primary);
    font-weight: 900;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Hamburger Menu Icon */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2100;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    text-decoration: none;
}

.nav-link:hover {
    color: var(--accent-primary);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--accent-glow);
}

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

.btn-outline:hover {
    background: var(--bg-glass);
    border-color: var(--accent-secondary);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-pill, 50px);
    transition: var(--transition);
}

.dropbtn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    min-width: 200px;
    z-index: 1000;
    margin-top: 0.5rem;
    padding: 0.8rem;
    background: #12121a; /* Solid dark background to prevent bleed-through */
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 10px 16px;
    display: block;
    border-radius: 8px;
    font-size: 0.9rem;
}

.dropdown-content a:hover {
    background-color: var(--bg-glass);
    color: var(--accent-secondary);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Footer - Professional & Cinematic */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-glass);
    padding: 6rem 0 3rem;
    margin-top: 8rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 1.5rem;
    max-width: 300px;
}

.footer-link-group h4, 
.footer-social h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-link-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-link-group a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-link-group a:hover {
    color: var(--accent-primary);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid var(--border-glass);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Main Content Padding */
.main-content {
    min-height: 80vh;
    padding: 8.5rem 2rem 3rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.float-anim {
    animation: float 6s ease-in-out infinite;
}

.slide-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse-hover:hover {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Premium Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

table {
    width: 100%;
    border-spacing: 0;
}

thead th {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-glass);
}

tbody td {
    padding: 1.25rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Reveal animations */
.reveal-up, .fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-up.active, .fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Dashboard Layout System */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-glow);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.1);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::after {
    opacity: 0.3;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin: 0.5rem 0;
}

.stat-card.failures .stat-value { color: var(--accent-primary); }
.stat-card.analyses .stat-value { color: var(--success); }
.stat-card.subscription .stat-value { 
    font-size: 2.2rem;
    color: var(--warning); 
}

/* Profile Dashboard System */
.profile-header-container {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    overflow: hidden;
}

.profile-avatar-large {
    width: 140px;
    height: 140px;
    border-radius: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    box-shadow: 0 10px 40px var(--accent-glow);
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.profile-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.badge-premium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Tab & Sidebar System */
.settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

.settings-sidebar {
    position: sticky;
    top: 8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tab-nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    width: 100%;
}

.tab-nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.tab-nav-btn.active {
    background: var(--bg-glass);
    border-color: var(--border-glass);
    color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-content-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content-pane.active {
    display: block;
}

/* Modern Toggles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-glass);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Form Sections */
.settings-section {
    margin-bottom: 3.5rem;
}

.settings-section h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .settings-layout { grid-template-columns: 1fr; gap: 2rem; }
    .settings-sidebar { position: sticky; top: 8rem; flex-direction: row; overflow-x: auto; padding-bottom: 1rem; background: var(--bg-main); z-index: 10; }
    .tab-nav-btn { white-space: nowrap; }
}

@media (max-width: 768px) {
    .navbar { padding: 1rem 0; width: 100%; top: 0; }
    .nav-container { 
        width: 92%; 
        border-radius: 20px; 
        height: 60px; 
        padding: 0 1.2rem;
    }
    
    .nav-toggle { display: block; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-glass-heavy);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: var(--transition);
        z-index: 2050;
        border-left: 1px solid var(--border-glass);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-link { font-size: 1.2rem; }
    
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .hero h1 { font-size: 2.8rem; }
    
    .dashboard-grid { grid-template-columns: 1fr; }
    .profile-header-container { flex-direction: column; text-align: center; padding: 2rem; }
    .profile-meta { justify-content: center; flex-wrap: wrap; }
    
    .glass-card { overflow-x: auto; }
    table { min-width: 600px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .nav-container { height: 55px; }
    .brand-logo .logo-img { height: 30px; }
    .stat-value { font-size: 2.5rem; }
}
