/* ========================================
   TOP NAVIGATION STYLES
   ======================================== */

/* Top Navigation Bar */
.top-nav {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: 60px;
    max-height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.top-nav.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Navigation Container */
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Main Content Padding */
.page-content,
.homepage {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
}

/* Logo */
.nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 32px;
    width: auto;
}

.logo-full {
    display: block;
}

.logo-mobile {
    display: none;
}

/* Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--success-color);
}

.nav-link.active {
    color: var(--success-color);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: inherit;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    overflow: hidden;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 0.9375rem;
}

.dropdown-item i {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.dropdown-item:hover {
    color: var(--success-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Action Buttons */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.9375rem;
    height: 36px;
}

.btn-icon i {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-icon:hover {
    background: var(--bg-secondary);
}

.nav-history {
    color: var(--text-secondary);
}

/* Theme Toggle Icons */
.theme-icon-dark,
.theme-icon-light {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Hide all icons by default */
.theme-icon-dark,
.theme-icon-light {
    display: none;
}

/* Show sun icon when in light mode */
[data-theme="light"] .theme-icon-light {
    display: block;
}

/* Show moon icon when in dark mode */
[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* Override theme toggle styles for nav (removes margin from global .theme-toggle) */
.nav-actions .theme-toggle {
    margin: 0;
    width: auto;
    padding: 0.5rem 0.75rem;
}

/* CTA Buttons in Nav */
.nav-drive-btn,
.nav-upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    height: 36px;
}

.nav-drive-btn i,
.nav-upload-btn i {
    width: 1.125rem;
    height: 1.125rem;
}

.nav-drive-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.nav-drive-btn:hover {
    background: var(--bg-tertiary);
}

.nav-upload-btn {
    background: var(--primary-color);
    color: white;
}

.nav-upload-btn:hover {
    background: var(--accent-hover);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    padding: 0.5rem;
}

.menu-icon-open,
.menu-icon-close {
    width: 1.5rem;
    height: 1.5rem;
}

.menu-icon-close {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon-open {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon-close {
    display: block;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    overflow-y: auto;
    z-index: 999;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    padding: 1rem;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.mobile-menu-item i {
    width: 1.25rem;
    height: 1.25rem;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: var(--bg-secondary);
}

.mobile-menu-item.indented {
    padding-left: 2.5rem;
    font-size: 0.9375rem;
}

.mobile-menu-section {
    margin: 1.5rem 0;
}

.mobile-menu-label {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-menu-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .nav-container {
        gap: 1rem;
    }

    .nav-links {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .btn-text {
        display: none;
    }

    .nav-drive-btn,
    .nav-upload-btn {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 768px) {
    /* Hide desktop nav links */
    .nav-links {
        display: none;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Switch to mobile logo */
    .logo-full {
        display: none;
    }

    .logo-mobile {
        display: block;
        height: 40px;
    }

    /* Simplify nav actions for mobile */
    .nav-actions {
        gap: 0.5rem;
    }

    .nav-history {
        padding: 0.5rem;
    }

    .btn-icon .btn-text {
        display: none;
    }

    .nav-container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .top-nav {
        min-height: 56px;
        max-height: 56px;
    }

    .mobile-menu {
        top: 56px;
        height: calc(100vh - 56px);
    }

    .nav-logo img {
        height: 36px;
    }

    .nav-container {
        padding: 0 1rem;
        height: 56px;
    }

    .nav-drive-btn,
    .nav-upload-btn {
        padding: 0.4rem 0.5rem;
        height: 32px;
    }

    .nav-drive-btn i,
    .nav-upload-btn i {
        width: 1.125rem;
        height: 1.125rem;
    }

    .page-content,
    .homepage {
        padding: 1.5rem 1rem 0;
    }
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Active page indication */
.nav-link[aria-current="page"] {
    color: var(--success-color);
}

.dropdown-item.active {
    color: var(--success-color);
}

/* Focus styles for accessibility */
.nav-link:focus-visible,
.dropdown-toggle:focus-visible,
.btn-icon:focus-visible,
.nav-drive-btn:focus-visible,
.nav-upload-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.mobile-menu-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Full-Width CTA Section */
.cta-section-fullwidth {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0066cc 100%);
    padding: 4rem 2rem;
    text-align: center;
    margin: 4rem 0 0 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.cta-section-fullwidth-content {
    max-width: 1400px;
    margin: 0 auto;
}

.cta-section-fullwidth h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.cta-section-fullwidth p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.cta-section-fullwidth .btn-primary {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.125rem;
    padding: 0.875rem 2rem;
}

.cta-section-fullwidth .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .cta-section-fullwidth {
        padding: 3rem 1.5rem;
    }

    .cta-section-fullwidth h2 {
        font-size: 1.75rem;
    }

    .cta-section-fullwidth p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cta-section-fullwidth {
        padding: 2.5rem 1rem;
    }

    .cta-section-fullwidth h2 {
        font-size: 1.5rem;
    }
}
