/* =============================================================================
   Site-Wide Navbar Styles
   Consolidated from dashboard navbar styling for consistent appearance
   ============================================================================= */

/* Navbar Header */
.navbar-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
}

/* Enhanced Navbar */
.navbar {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Navbar container for two-line layout */
.navbar .container-fluid {
    display: flex;
    flex-direction: column; /* Stack rows vertically */
    width: 100%;
}

/* Two-Line Navbar Layout */
.navbar-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.navbar-row-main {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.navbar-row-secondary {
    padding: 0.375rem 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    min-height: 40px; /* Ensure minimum height */
    display: flex !important; /* Force display */
    align-items: center;
}

.navbar-secondary-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 1rem;
    min-height: 30px; /* Ensure minimum height */
}

.navbar-secondary-item {
    display: flex;
    align-items: center;
    position: relative;
}

/* Navbar Brand/Logo */
.navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-blue, #005fcc) !important;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.navbar-brand:hover {
    color: var(--brand-blue-hover, #004499) !important;
    text-decoration: none;
}

.navbar-brand i {
    color: var(--brand-blue, #005fcc);
}

/* Navbar Logo */
.navbar-logo {
    height: 32px;
    width: auto;
    max-width: 48px;
    object-fit: contain;
    filter: brightness(1);
    transition: filter 0.2s ease-in-out;
}

.navbar-brand:hover .navbar-logo {
    filter: brightness(1.2);
}

/* Navigation Links */
.navbar-nav .nav-link {
    position: relative;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-dark, #212529) !important;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link:hover {
    color: var(--brand-blue, #005fcc) !important;
    background-color: rgba(0, 95, 204, 0.1);
    text-decoration: none;
}

.navbar-nav .nav-link.active {
    color: var(--brand-blue, #005fcc) !important;
    background-color: rgba(0, 95, 204, 0.15);
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background-color: var(--brand-blue, #005fcc);
    border-radius: 1px;
}

/* Dropdown Styling */
.navbar-nav .dropdown-toggle::after {
    margin-left: 0.5rem;
}

.dropdown-menu {
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: var(--text-dark, #212529);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: rgba(0, 95, 204, 0.1);
    color: var(--brand-blue, #005fcc);
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

/* Navbar Text */
.navbar-text {
    color: var(--text-dark, #212529);
    font-size: 0.8rem;
    margin: 0;
}

/* Mobile Toggle Button */
.navbar-toggler {
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 95, 204, 0.25);
    outline: none;
}

.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='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.breadcrumb {
    margin: 0;
    padding: 0.75rem 0;
    background: transparent;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: var(--text-dark, #212529);
}

.breadcrumb-item a {
    color: var(--brand-blue, #005fcc);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.breadcrumb-item a:hover {
    color: var(--brand-blue-hover, #004499);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-dark, #212529);
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
    margin: 0 0.5rem;
}

.breadcrumb-item:first-child a {
    font-weight: 500;
    color: var(--brand-blue, #005fcc);
}

.breadcrumb-item:first-child a:hover {
    color: var(--brand-blue-hover, #004499);
}

/* Tagline */
.tagline-container {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0.5rem 0;
}

.site-tagline {
    margin: 0;
    color: var(--text-dark, #212529);
    font-style: italic;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* =============================================================================
   RESPONSIVE DESIGN - Mobile First Approach
   ============================================================================= */

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    .navbar-brand span {
        font-size: 1.25rem;
    }
    
    .navbar-logo {
        height: 36px;
        max-width: 52px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.625rem 1.25rem;
        font-size: 1rem !important;
    }
}

/* Desktop (1200px to 1399px) */
@media (max-width: 1399px) and (min-width: 1200px) {
    .navbar-brand span {
        font-size: 1.2rem;
    }
    
    .navbar-logo {
        height: 34px;
        max-width: 50px;
    }
}

/* Large Tablet (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .navbar-brand span {
        font-size: 1.1rem;
    }
    
    .navbar-logo {
        height: 32px;
        max-width: 48px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.95rem !important;
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .navbar-brand span {
        font-size: 1rem;
    }
    
    .navbar-logo {
        height: 30px;
        max-width: 44px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.875rem;
        font-size: 0.9rem !important;
    }
    
    .navbar-secondary-container {
        gap: 0.75rem;
    }
    
    .global-search-input {
        font-size: 0.875rem;
    }
    
    #recentWorkDropdown {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .navbar-logo {
        height: 28px;
        max-width: 40px;
    }
    
    .navbar-brand span {
        font-size: 0.95rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.375rem 0.75rem;
        margin: 0 0.125rem;
        font-size: 0.875rem !important;
    }
    
    .site-tagline {
        font-size: 0.8rem;
        padding: 0 10px;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.25rem;
    }
    
    .breadcrumb-item:first-child a {
        font-size: 0.8rem;
    }

    /* Mobile: Stack secondary items vertically */
    .navbar-secondary-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .navbar-secondary-item {
        width: 100%;
    }

    .navbar-row-secondary {
        padding: 0.5rem 0;
    }
    
    .global-search-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .global-search-input {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    #recentWorkDropdown {
        font-size: 0.875rem;
        padding: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    #recentWorkList .dropdown-item {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    #recentWorkList {
        right: auto;
        left: 0;
        width: 100%;
    }
}

/* Mobile Small (320px to 575px) */
@media (max-width: 575px) {
    .navbar-logo {
        height: 24px;
        max-width: 36px;
    }
    
    .navbar-brand span {
        font-size: 0.9rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem !important;
        margin: 0.125rem 0;
    }
    
    .dropdown-item {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Mobile: Keep secondary navbar visible but compact */
    .navbar-row-secondary {
        padding: 0.25rem 0;
    }
    
    .site-tagline {
        font-size: 0.75rem;
        padding: 0 8px;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
        padding: 0.5rem 0;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.25rem;
    }
    
    .global-search-form {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .global-search-input {
        font-size: 0.875rem;
        padding: 0.375rem;
    }
    
    #recentWorkDropdown {
        font-size: 0.875rem;
        padding: 0.375rem;
        width: 100%;
        justify-content: center;
    }
    
    #recentWorkList .dropdown-item {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .navbar-logo {
        height: 20px;
        max-width: 32px;
    }
    
    .navbar-brand span {
        font-size: 0.8rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.25rem 0.375rem;
        font-size: 0.8rem !important;
    }
    
    .site-tagline {
        font-size: 0.7rem;
        padding: 0 6px;
    }
    
    .breadcrumb {
        font-size: 0.7rem;
        padding: 0.375rem 0;
    }
    
    .global-search-input {
        font-size: 0.8rem;
        padding: 0.25rem;
    }
    
    #recentWorkDropdown {
        font-size: 0.8rem;
        padding: 0.25rem;
    }
    
    #recentWorkList .dropdown-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.375rem;
    }
    
    #recentWorkList {
        right: auto;
        left: 0;
        width: 100%;
    }
}

/* =============================================================================
   DARK THEME SUPPORT
   ============================================================================= */

body.theme-dark .navbar-header {
    background-color: #2c3e50 !important;
}

body.theme-dark .navbar {
    background-color: #2c3e50 !important;
    border-bottom-color: #4a5f7a !important;
}

body.theme-dark .navbar-row-secondary {
    background-color: #34495e !important;
    border-bottom-color: #4a5f7a !important;
}

body.theme-dark .navbar-nav .nav-link {
    color: #ecf0f1 !important;
}

body.theme-dark .navbar-nav .nav-link:hover {
    color: #4dabf7 !important;
    background-color: rgba(77, 171, 247, 0.2) !important;
}

body.theme-dark .navbar-nav .nav-link.active {
    color: #4dabf7 !important;
    background-color: rgba(77, 171, 247, 0.15) !important;
}

body.theme-dark .navbar-brand {
    color: #4dabf7 !important;
}

body.theme-dark .navbar-brand:hover {
    color: #74c0fc !important;
}

body.theme-dark .navbar-brand i {
    color: #4dabf7;
}

body.theme-dark .navbar-text {
    color: #ecf0f1;
}

body.theme-dark .navbar-toggler {
    border-color: #4a5f7a;
}

body.theme-dark .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(77, 171, 247, 0.25);
}

body.theme-dark .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='rgba%28236, 240, 241, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

body.theme-dark .dropdown-menu {
    background-color: #34495e;
    border-color: #4a5f7a;
}

body.theme-dark .dropdown-item {
    color: #ecf0f1;
}

body.theme-dark .dropdown-item:hover {
    background-color: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
}

body.theme-dark .breadcrumb-nav,
body.theme-dark .tagline-container {
    background-color: #34495e;
    border-top-color: #4a5f7a;
}

body.theme-dark .breadcrumb-item {
    color: #ecf0f1;
}

body.theme-dark .breadcrumb-item a {
    color: #4dabf7;
}

body.theme-dark .tagline-container {
    background-color: #34495e;
}

body.theme-dark .site-tagline {
    color: #ecf0f1;
}

/* =============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================= */

@media (prefers-contrast: high) {
    .navbar-nav .nav-link {
        border: 1px solid currentColor;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        border-width: 2px;
    }
    
    .breadcrumb-item a {
        text-decoration: underline;
    }
    
    .breadcrumb-item a:hover {
        text-decoration: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar-nav .nav-link,
    .navbar-brand,
    .navbar-logo {
        transition: none;
    }
    
    .navbar-nav .nav-link:hover {
        transition: none;
    }
    
    .dropdown-item:hover {
        transition: none;
    }
}

/* =============================================================================
   FOCUS MANAGEMENT
   ============================================================================= */

.navbar-nav .nav-link:focus,
.navbar-brand:focus,
.navbar-toggler:focus {
    outline: 2px solid var(--brand-blue, #005fcc);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .navbar-nav .nav-link:focus,
    .navbar-brand:focus,
    .navbar-toggler:focus {
        outline: 3px solid;
        outline-offset: 1px;
    }
}

/* =============================================================================
   GLOBAL SEARCH STYLES
   ============================================================================= */

.global-search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.global-search-input {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    min-width: 200px;
    background-color: #ffffff !important; /* Ensure visibility */
    color: #212529 !important; /* Ensure text is visible */
    display: block !important; /* Ensure it's visible */
}

.global-search-input:focus {
    border-color: var(--brand-blue, #005fcc);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 95, 204, 0.25);
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #ff0000 !important; /* RED BORDER FOR DEBUGGING */
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    min-height: 50px; /* Ensure minimum height for debugging */
}

.global-search-results.show {
    display: block;
}

.global-search-group {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6c757d;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.global-search-group:last-child {
    border-bottom: none;
}

.global-search-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-dark, #212529);
}

.global-search-item:hover, 
.global-search-item.active {
    background-color: rgba(0, 95, 204, 0.1);
    color: var(--brand-blue, #005fcc);
}

.global-search-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
    color: var(--brand-blue, #005fcc);
}

.global-search-item.text-muted {
    color: #6c757d;
    font-style: italic;
}

.global-search-item.text-muted:hover {
    background-color: transparent;
    color: #6c757d;
}

/* =============================================================================
   RECENT WORK DROPDOWN STYLES
   ============================================================================= */

#recentWorkDropdown {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: var(--text-dark, #212529);
}

#recentWorkDropdown:hover {
    border-color: var(--brand-blue, #005fcc);
    background-color: rgba(0, 95, 204, 0.05);
}

#recentWorkList {
    min-width: 250px;
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    margin-top: 0.25rem;
}

#recentWorkList .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-dark, #212529);
}

#recentWorkList .dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
    color: var(--brand-blue, #005fcc);
}

#recentWorkList .dropdown-item small {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: auto;
}

#recentWorkList .dropdown-item-text {
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

/* =============================================================================
   RESPONSIVE SEARCH & RECENT WORK
   ============================================================================= */

@media (max-width: 768px) {
    .global-search-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .global-search-input {
        min-width: 100%;
        font-size: 0.875rem;
    }
    
    #recentWorkDropdown {
        font-size: 0.875rem;
        padding: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    #recentWorkList .dropdown-item {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .global-search-form {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .global-search-input {
        min-width: 100%;
        font-size: 0.875rem;
        padding: 0.375rem;
    }
    
    #recentWorkDropdown {
        font-size: 0.875rem;
        padding: 0.375rem;
        width: 100%;
        justify-content: center;
    }
    
    #recentWorkList .dropdown-item {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
}

/* =============================================================================
   DARK THEME SEARCH & RECENT WORK
   ============================================================================= */

body.theme-dark .global-search-input {
    background-color: #34495e;
    border-color: #4a5f7a;
    color: #ecf0f1;
}

body.theme-dark .global-search-input:focus {
    border-color: #4dabf7;
    box-shadow: 0 0 0 0.2rem rgba(77, 171, 247, 0.25);
}

body.theme-dark .global-search-results {
    background-color: #34495e;
    border-color: #4a5f7a;
}

body.theme-dark .global-search-item {
    color: #ecf0f1;
}

body.theme-dark .global-search-item:hover,
body.theme-dark .global-search-item.active {
    background-color: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
}

body.theme-dark .global-search-item i {
    color: #4dabf7;
}

body.theme-dark #recentWorkDropdown {
    background-color: #34495e;
    border-color: #4a5f7a;
    color: #ecf0f1;
}

body.theme-dark #recentWorkDropdown:hover {
    border-color: #4dabf7;
    background-color: rgba(77, 171, 247, 0.1);
}

body.theme-dark #recentWorkList .dropdown-item {
    color: #ecf0f1;
}

body.theme-dark #recentWorkList .dropdown-item:hover {
    background-color: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
}

body.theme-dark #recentWorkList .dropdown-item i {
    color: #4dabf7;
}

body.theme-dark #recentWorkList .dropdown-item small {
    color: #bdc3c7;
}

body.theme-dark #recentWorkList .dropdown-item-text {
    color: #bdc3c7;
} 