/* Theme Variables - Centralized */
:root {
    /* Dark Theme (Default) */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --input-bg: #1e293b;
    --border-color: rgba(255, 255, 255, 0.2);
    --success-color: #10b981;
    --error-color: #ef4444;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --nav-bg: rgba(15, 23, 42, 0.95);
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Light Theme */
[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --input-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
    --nav-bg: rgba(248, 250, 252, 0.95);
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Top Navigation Bar - Uniform across all pages */
.top-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px var(--shadow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.nav-tagline {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-primary);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: currentColor;
    background-clip: unset;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    min-height: 1em;
    display: block;
}

@keyframes typing {
    0%, 10% { width: 0; }
    50%, 90% { width: 100%; }
    100% { width: 0; }
}

@keyframes blink {
    0%, 50% { border-color: #ffffff; }
    51%, 100% { border-color: transparent; }
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-icon {
    font-size: 1.1rem;
}

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

.dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
    animation: dropdownFade 0.2s ease;
}

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

.dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-content a:hover {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.dropdown-content a.view-all {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: rotate(15deg);
}

.theme-icon {
    display: block;
    line-height: 1;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem 1rem;
    }
    
    .nav-left {
        flex: 0 0 auto;
    }
    
    .nav-logo {
        font-size: 1.1rem;
    }
    
    .nav-tagline {
        display: none;
    }
    
    .nav-right {
        gap: 0.3rem;
        flex: 1;
        justify-content: flex-end;
    }
    
    .nav-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        min-width: 48px;
        min-height: 44px;
        justify-content: center;
        border: 1.5px solid var(--border-color);
    }
    
    .nav-btn span.nav-icon {
        font-size: 1rem;
    }
    
    .dropdown-arrow {
        display: none;
    }
    
    .dropdown-content {
        min-width: 200px;
        right: 0;
        left: auto;
    }
    
    .dropdown-content a {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .theme-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        border: 1.5px solid var(--border-color);
    }
    
    /* Small mobile - vertical layout with text labels */
    @media (max-width: 480px) {
        .top-nav {
            position: sticky;
            top: 0;
            z-index: 1000;
            background: var(--card-bg);
            border-bottom: 2px solid var(--border-color);
        }
        
        .nav-container {
            flex-direction: column;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
        }
        
        .nav-left {
            width: 100%;
            text-align: center;
        }
        
        .nav-logo {
            font-size: 1.3rem;
        }
        
        .nav-right {
            width: 100%;
            justify-content: space-between;
            gap: 0.5rem;
        }
        
        .nav-btn {
            flex: 1;
            flex-direction: column;
            gap: 0.25rem;
            padding: 0.6rem 0.4rem;
            font-size: 0.7rem;
            font-weight: 600;
            min-height: 60px;
            border: 2px solid var(--border-color);
        }
        
        .nav-btn span.nav-icon {
            display: block;
            font-size: 1.5rem;
        }
        
        .nav-btn:hover,
        .nav-btn.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
            transform: translateY(-2px);
        }
        
        .theme-toggle {
            min-width: 60px;
            min-height: 60px;
            border: 2px solid var(--border-color);
        }
        
        .theme-toggle .theme-icon {
            font-size: 1.5rem;
        }
    }
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Adjust container to account for sticky nav */
body {
    padding-top: 0;
}

/* Original container adjustments */
.container {
    margin-top: 1rem;
}
