﻿/* Modern Header Styles - SchoolBanks */

.modern-header {
    background: #ffffff;
    border-bottom: 2px solid #7BA43F;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.3rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.header-logo {
    max-height: 36px;
    width: auto;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

.header-top-left,
.header-top-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-top-left {
    flex: 1 1 auto;
    min-width: 0;
}

.header-top-right {
    flex: 0 0 auto;
}

.header-menu-row {
    margin-top: 0.4rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.32rem;
}

.header-primary-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.25rem;
}

.section-scope-wrapper {
    min-width: 140px;
    max-width: 260px;
}

.section-scope-select {
    min-width: 140px;
    /* At narrow widths (see mobile min-width override below) a long district/section
       name gets clipped by the input's fixed width - ellipsis at least signals the
       text is truncated instead of silently cutting off mid-word (Issue #2761). */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Navigation Styles */
.navbar {
    padding: 0;
}

.navbar-nav {
    align-items: center;
}

.nav-item {
    margin: 0 0.25rem;
}

.nav-link {
    color: #1a202c !important;
    font-weight: 500;
    padding: 0.4rem 0.8rem !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover,
.nav-link:focus {
    background-color: #f7fafc;
    color: #7BA43F !important;
}

.nav-link i {
    font-size: 1.1em;
}

/* Dropdown Styles */
.modern-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 220px;
}

.modern-dropdown .dropdown-item {
    padding: 0.625rem 1.25rem;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.modern-dropdown .dropdown-item i {
    color: #7BA43F;
    width: 18px;
    text-align: center;
}

.modern-dropdown .dropdown-item:hover,
.modern-dropdown .dropdown-item:focus {
    background-color: #f7fafc;
    color: #7BA43F;
}

.modern-dropdown .dropdown-header {
    padding: 0.625rem 1.25rem;
    color: #4a5568;
    font-size: 0.875rem;
}

.modern-dropdown .dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e2e8f0;
}

/* Profile Button Styles */
.profile-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 0.3rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    color: #1a202c;
}

.profile-btn:hover,
.profile-btn:focus {
    border-color: #7BA43F;
    background-color: #f7fafc;
    color: #1a202c;
}

.profile-btn::after {
    margin-left: 0.5rem;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background-color: #7BA43F;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.profile-avatar[style*="background-image"] {
    color: transparent;
}

.profile-name {
    font-weight: 500;
    color: #1a202c;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .modern-header {
        padding: 0.25rem 0;
    }

    .header-top-row {
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .header-top-left,
    .header-top-right {
        width: auto;
        justify-content: flex-start;
    }

    .header-menu-row {
        margin-top: 0.25rem;
    }

    .header-logo {
        max-height: 36px;
    }

    .navbar-toggler {
        border-color: #7BA43F;
        padding: 0.375rem 0.5rem;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%237BA43F' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    .navbar-collapse {
        margin-top: 1rem;
        background: #ffffff;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .nav-item {
        margin: 0.25rem 0;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
    }

    .nav-text {
        margin-left: 0.5rem;
    }

    .modern-dropdown {
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        margin-top: 0;
    }

    .profile-btn {
        padding: 0.25rem 0.5rem;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .section-scope-wrapper {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 180px;
    }

    .section-scope-select {
        min-width: 110px;
    }
}

@media (max-width: 575.98px) {
    .profile-btn {
        border-radius: 50%;
        padding: 0.375rem;
    }

    .profile-btn::after {
        display: none;
    }
}

/* Accessibility */
.nav-link:focus,
.dropdown-item:focus,
.profile-btn:focus {
    outline: 2px solid #7BA43F;
    outline-offset: 2px;
}
