/* Public Navigation Styles */

.public-nav {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.public-nav .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.public-nav .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

/* Logo */
.public-nav .nav-logo {
    flex-shrink: 0;
}

.public-nav .nav-logo a {
    color: var(--brand-primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

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

/* Desktop Navigation */
.public-nav .nav-desktop {
    display: none;
}

@media (min-width: 768px) {
    .public-nav .nav-desktop {
        display: block;
    }
}

.public-nav .nav-menu {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-left: 2.5rem;
}

.public-nav .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.public-nav .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--surface-light);
}

.public-nav .nav-link.active {
    color: var(--text-primary);
    background-color: var(--surface-light);
}

/* Mobile Menu Button */
.public-nav .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.public-nav .mobile-menu-btn:hover {
    color: var(--text-primary);
    background-color: var(--surface-light);
}

.public-nav .mobile-menu-btn:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .public-nav .mobile-menu-btn {
        display: none;
    }
}

.public-nav .mobile-menu-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Mobile Menu */
.public-nav .mobile-menu {
    display: block;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-primary);
}

.public-nav .mobile-menu.hidden {
    display: none;
}

@media (min-width: 768px) {
    .public-nav .mobile-menu {
        display: none !important;
    }
}

.public-nav .mobile-menu-content {
    padding: 0.5rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.public-nav .mobile-menu .nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 40;
}

.theme-toggle-btn:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.05);
}

.theme-toggle-btn:hover .theme-icon {
    color: var(--brand-primary) !important;
}

.theme-toggle-btn:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.theme-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-secondary);
    transition: opacity 0.2s ease;
}

.theme-icon.theme-icon-light {
    display: block;
}

.theme-icon.theme-icon-dark {
    display: none;
}

/* Theme-specific icon visibility - Only Light/Dark toggle */
[data-theme="light"] .theme-icon.theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon.theme-icon-dark {
    display: block;
}

[data-theme="dark"] .theme-icon.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon.theme-icon-light {
    display: block;
}

/* Ensure theme icons are always visible with proper contrast */
.theme-toggle-btn .theme-icon {
    color: var(--text-secondary) !important;
    stroke: var(--text-secondary) !important;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon {
    color: var(--text-primary) !important;
    stroke: var(--text-primary) !important;
}

[data-theme="light"] .theme-toggle-btn .theme-icon {
    color: var(--text-secondary) !important;
    stroke: var(--text-secondary) !important;
}

/* Extra specificity for SVG elements */
#theme-toggle svg.theme-icon {
    color: var(--text-secondary) !important;
    stroke: var(--text-secondary) !important;
}

[data-theme="dark"] #theme-toggle svg.theme-icon {
    color: var(--text-primary) !important;
    stroke: var(--text-primary) !important;
}

[data-theme="light"] #theme-toggle svg.theme-icon {
    color: var(--text-secondary) !important;
    stroke: var(--text-secondary) !important;
}

/* Force override any global SVG styles that might interfere */
body[data-theme="dark"] #theme-toggle svg,
html[data-theme="dark"] #theme-toggle svg {
    color: var(--text-primary) !important;
    stroke: var(--text-primary) !important;
    fill: none !important;
}

body[data-theme="light"] #theme-toggle svg,
html[data-theme="light"] #theme-toggle svg {
    color: var(--text-secondary) !important;
    stroke: var(--text-secondary) !important;
    fill: none !important;
}

/* Theme toggle button backgrounds for better visibility */
[data-theme="dark"] .theme-toggle-btn {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-secondary) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] .theme-toggle-btn {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    z-index: 60;
    transition: width 0.1s ease;
}



/* Responsive adjustments */
@media (max-width: 767px) {
    .public-nav .nav-content {
        height: 3.5rem;
    }
    
    .public-nav .nav-logo a {
        font-size: 1.25rem;
    }
    
    .theme-toggle-btn {
        bottom: 2rem;
        left: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .theme-icon {
        width: 1rem;
        height: 1rem;
    }
}

/* Medium to large screen adjustments */
@media (max-width: 1400px) and (min-width: 768px) {
    .theme-toggle-btn {
        bottom: 2rem;
        left: 1.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .public-nav {
        border-bottom-width: 2px;
    }
    
    .public-nav .nav-link:focus,
    .public-nav .mobile-menu-btn:focus,
    .theme-toggle-btn:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .public-nav,
    .public-nav .nav-link,
    .public-nav .mobile-menu-btn,
    .theme-toggle-btn,
    .theme-icon,
    .reading-progress {
        transition: none;
    }
    
    .theme-toggle-btn:hover {
        transform: none;
    }
} 