/* Header Styles */
.site-header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    overflow: hidden;
}

.navbar-brand {
    display: none;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.navbar-nav {
    margin-left: 0 !important;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: #00224D;
    margin: 0 10px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, 7vw, 36px);
    height: clamp(28px, 7vw, 36px);
    position: relative;
    /* Keep navigation pills beige regardless of theme */
    background-color: var(--beige) !important;
    border-radius: 50%;
}

/* Animated underline for hover/active state */
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link.active {
    color: var(--secondary-color);
}

.nav-link:hover {
    color: var(--secondary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Active nav underline color */
.nav-link.active::after {
    background-color: #000;
}

/* Ensure underline stays black on hover */
.nav-link:hover::after {
    background-color: #000;
}

/* Glossy header effect */
.site-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--header-bg);
    z-index: -1;
    border-radius: 50px;
}

/* Theme Toggle Button */
.theme-toggle {
    cursor: pointer;
    width: clamp(28px, 7vw, 36px);
    height: clamp(28px, 7vw, 36px);
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.theme-toggle.light {
    color: #000;
}

.theme-toggle.dark {
    color: var(--beige);
}

.theme-toggle .icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
    transition: all 0.5s ease;
}

.theme-toggle .icon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    /* Solid color to ensure the crescent blends correctly */
    background: #000;
    opacity: 0;
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.theme-toggle.dark .icon {
    /* Beige circle for the moon */
    background: var(--beige);
    /* Create crescent by masking with a solid color */
    box-shadow: inset -8px -8px 0 0 #000;
}

.theme-toggle.dark .icon::before {
    opacity: 1;
    transform: scale(1);
}

.theme-toggle.light .icon {
    /* Black sun with minimalistic rays */
    background: #000;
    box-shadow:
        0 -6px 0 #000,
        0 6px 0 #000,
        6px 0 0 #000,
        -6px 0 0 #000,
        4px 4px 0 #000,
        -4px 4px 0 #000,
        4px -4px 0 #000,
        -4px -4px 0 #000;
}

.theme-toggle.light .icon::before {
    opacity: 0;
    transform: scale(0);
}

.theme-toggle .icon-animate {
    animation: rotateScale 0.6s ease;
}

@keyframes rotateScale {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}
/* Scrolled state */
.site-header.navbar-scrolled {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Icon + text visibility */
.nav-item i {
    color: var(--icon-color) !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    margin-right: 0;
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    line-height: 1;
    transition: color 0.3s ease, font-size 0.3s ease;
}

/* Ensure icons themselves never display a background circle */
.nav-link i {
    background-color: transparent !important;
    border-radius: 0 !important;
}


.nav-text {
    display: none;
    transition: opacity 0.2s ease;
}

@media (max-width: 768px) {
    .nav-text {
        display: none;
    }
}
.nav-link .fa-circle-user {
    color: var(--icon-color) !important;
}

/* Container for React dark mode switch */
#dark-mode-toggle {
    width: clamp(28px, 7vw, 36px);
    height: clamp(28px, 7vw, 36px);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .site-header {
        bottom: 20px;
    }
}

@media (max-width: 576px) {
    .site-header {
        bottom: 10px;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 420px) {
    .site-header {
        width: 100%;
        max-width: none;
    }
    .nav-link {
        width: clamp(28px, 9vw, 36px);
        height: clamp(28px, 9vw, 36px);
    }
    .nav-item i {
        font-size: clamp(0.8rem, 4vw, 1rem);
    }
}

@media (max-width: 320px) {
    .site-header {
        width: 100%;
    }
}

/* Desktop sizing */
@media (min-width: 992px) {
    .site-header {
        width: 480px;
        max-width: 480px;
    }
    .site-header .nav-link {
        width: 32px;
        height: 32px;
    }

    /* Navbar shrink effect on large screens */
    .site-header.navbar-shrink {
        padding: 0.25rem 0.75rem;
        width: 360px;
        max-width: 360px;
    }
    .site-header.navbar-shrink .nav-link {
        width: 28px;
        height: 28px;
    }
    .site-header.navbar-shrink .nav-item i {
        font-size: 0.9rem;
    }
}

