/* Expandable Theme Switcher Styles */
.theme-switcher {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.theme-switcher.collapsed {
    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

.theme-switcher.collapsed .theme-switcher-content {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    pointer-events: none;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
}

.theme-toggle-btn:focus {
    outline: none;
}

.theme-switcher.collapsed .theme-toggle-btn {
    margin: 10px auto;
}

.theme-switcher-content {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 10px;
}

.theme-switcher:not(.collapsed) {
    width: auto !important;
    height: auto !important;
    padding: 15px !important;
    border-radius: 50px !important;
}

/* Mobile adjustments for expandable switcher */
@media (max-width: 768px) {
    .theme-switcher.collapsed {
        width: 50px !important;
        height: 50px !important;
    }

    .theme-toggle-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .theme-switcher.collapsed .theme-toggle-btn {
        margin: 7.5px auto;
    }
}

/* Fix for header tab active state */
.ftco-navbar-light .navbar-nav>.nav-item.active>a,
.ftco-navbar-light .navbar-nav>.nav-item.active>a:hover,
.ftco-navbar-light .navbar-nav>.nav-item.active>a:focus {
    color: var(--primary-color) !important;
}

.ftco-navbar-light.scrolled .navbar-nav>.nav-item.active>a,
.ftco-navbar-light.awake .navbar-nav>.nav-item.active>a {
    color: var(--primary-color) !important;
}

/* Ensure navigation links respond to theme */
.navbar-nav .nav-link {
    transition: color 0.3s ease !important;
}

/* Navigation hover state */
.ftco-navbar-light .navbar-nav>.nav-item>a:hover {
    color: var(--primary-color) !important;
}

/* Active tab underline - targeting the span::before */
.ftco-navbar-light .navbar-nav>.nav-item>.nav-link.active span::before,
.ftco-navbar-light .navbar-nav>.nav-item.active>.nav-link span::before,
.ftco-navbar-light .navbar-nav>.nav-item.active>a span::before {
    background: var(--primary-color) !important;
    visibility: visible !important;
    transform: scaleX(1) !important;
}

/* Fix for ALL nav link underlines (including hover on inactive tabs) */
.ftco-navbar-light .navbar-nav>.nav-item>.nav-link span::before {
    background: var(--primary-color) !important;
}

/* Also ensure the text color of the span is correct */
.ftco-navbar-light .navbar-nav>.nav-item>.nav-link.active span,
.ftco-navbar-light .navbar-nav>.nav-item.active>.nav-link span,
.ftco-navbar-light .navbar-nav>.nav-item.active>a span {
    color: var(--primary-color) !important;
}

/* Force override for all navbar states */
nav .navbar-nav .nav-item.active .nav-link,
nav .navbar-nav .nav-item.active a,
.site-navbar-target .navbar-nav .nav-item.active a {
    color: var(--primary-color) !important;
}

/* Scrolled state */
.ftco-navbar-light.scrolled .navbar-nav .nav-item.active a {
    color: var(--primary-color) !important;
}