/* Secondary Navigation Styles */
.top-navbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100; /* Increased from 1030 to be above other content */
    height: 40px;
    display: flex;
    align-items: center;
}

.top-navbar .container {
    display: flex;
    justify-content: flex-end;
    padding: 0 15px;
}

.top-navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.top-navbar-nav .nav-item {
    position: relative;
    margin-left: 1.5rem;
}

.top-navbar-nav .nav-link {
    color: #495057;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease-in-out;
    border-radius: 4px;
}

.top-navbar-nav .nav-link:hover {
    color: #1e40af;
    background-color: rgba(30, 64, 175, 0.05);
}

.search-text {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Search Component Styles */
.search-item {
    position: relative;
}

.search-toggle {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
}

.search-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-toggle i {
    font-size: 1rem;
    color: #4a5568;
}

.search-form-container {
    position: fixed;
    top: 40px; /* Start below the top navbar */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1199; /* Just below the top navbar */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
    padding: 1.5rem 0 3rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

.search-form-container[aria-hidden="false"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-form-container[aria-hidden="false"] .search-form-wrapper {
    transform: translateY(0);
    opacity: 1;
}

.search-form-wrapper {
    max-width: 700px;
    width: 90%;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform: translateY(-20px);
    transition: all 0.3s ease-out 0.1s;
    opacity: 0;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.search-form .input-group {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
}

.search-input {
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 1rem 1.5rem 1rem 3.5rem;
    font-size: 1.1rem;
    width: 100%;
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: auto;
    line-height: 1.5;
}

.search-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.3);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    color: #718096;
    z-index: 5;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.search-clear,
.search-submit {
    background: transparent;
    border: none;
    color: #a0aec0;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
}

.search-clear:hover,
.search-submit:hover {
    color: #4a5568;
}

.search-submit {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #1e40af;
    color: white;
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: -1px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.search-suggestions.active {
    display: block;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #edf2f7;
}

.suggestions-header h6 {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
}

.suggestions-body {
    padding: 0.5rem 0;
}

.suggestion-item {
    padding: 0.5rem 1rem;
}

.suggestion-link {
    display: flex;
    align-items: center;
    color: #4a5568;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.suggestion-link:hover {
    background-color: #f7fafc;
    color: #2b6cb0;
}

.suggestion-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    color: #a0aec0;
}

.search-results {
    padding: 0.5rem 0;
    border-top: 1px solid #edf2f7;
}

.search-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #edf2f7;
    text-align: right;
}

/* Loading State */
.search-loading {
    padding: 1rem;
    text-align: center;
    color: #718096;
}

.search-loading::after {
    content: "";
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .top-navbar {
        display: none;
    }
    
    .navbar-modern {
        top: 0 !important;
    }
    
    .top-navbar-spacer {
        display: none;
    }
    
    .search-form-container {
        padding: 0.75rem 1rem;
    }
    
    .search-form .input-group {
        height: 44px;
    }
    
    .search-form .search-input {
        height: 42px;
        font-size: 0.9375rem;
    }
    
    .search-suggestions {
        max-height: 70vh;
    }
}

/* Spacer to prevent content from being hidden behind fixed navbar */
.top-navbar-spacer {
    height: 40px;
    margin-bottom: 1rem;
}

/* Adjust main navbar position to account for secondary navbar */
.navbar-modern {
    top: 40px !important;
}

/* Adjust the spacer after the main navbar */
.navbar-spacer {
    height: 100px;
}
