/* Header Search Panel Styles */
.header-search-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .header-search-panel.active {
        display: block;
        opacity: 1;
    }

.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 43, 74, 0.95);
    backdrop-filter: blur(5px);
}

.search-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    transform: translateY(-30px);
    transition: transform 0.3s ease;
}

.header-search-panel.active .search-content {
    transform: translateY(0);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .search-header h3 {
        color: white;
        font-weight: 600;
        margin: 0;
        font-size: 1.5rem;
    }

.search-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s ease, color 0.2s ease;
    line-height: 1;
}

    .search-close-btn:hover {
        transform: scale(1.1);
        color: #f59e0b;
    }

.search-body {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    /* Added max-height for fixed size */
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    margin-bottom: 2rem;
    /* Added flex-shrink to prevent input from shrinking */
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.25rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.125rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .search-input:focus {
        outline: none;
        border-color: #1a2b4a;
        box-shadow: 0 0 0 3px rgba(26, 43, 74, 0.1);
    }

.search-clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

    .search-clear-btn:hover {
        color: #64748b;
    }

/* Quick Links */
.search-results {
    /* Removed margin-bottom and padding-bottom */
    /* Added flex-grow and overflow for scrollable content */
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Added padding-right for scrollbar spacing */
    padding-right: 0.5rem;
}

    .search-results h5 {
        color: #1a2b4a;
        font-weight: 600;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 1rem;
        /* Added sticky positioning for header */
        position: sticky;
        top: 0;
        background-color: white;
        padding: 0.5rem 0;
        z-index: 1;
    }

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* Added padding-bottom for scroll spacing */
    padding-bottom: 1rem;
}

.result-item {
    display: flex;
    align-items: start;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .result-item:hover {
        background-color: #e2e8f0;
        transform: translateX(5px);
    }

.result-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a2b4a;
    color: white;
    border-radius: 6px;
    margin-right: 1rem;
    font-size: 1.25rem;
}

.result-content {
    flex-grow: 1;
}

.result-title {
    color: #1a2b4a;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.result-description {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.result-category {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background-color: #f59e0b;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Popular Searches */

/* Responsive Design */
@media (max-width: 768px) {
    .search-content {
        padding: 1rem 0.5rem;
    }

    .search-body {
        padding: 1.5rem;
        /* Adjusted max-height for mobile */
        max-height: calc(100vh - 150px);
    }

    .search-header h3 {
        font-size: 1.25rem;
    }

    .search-input {
        font-size: 1rem;
        padding: 0.875rem 3rem 0.875rem 3rem;
    }

    .quick-link-tag {
        font-size: 0.8125rem;
        padding: 0.4rem 0.875rem;
    }

    .result-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .result-title {
        font-size: 0.9375rem;
    }

    .result-description {
        font-size: 0.8125rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeIn 0.3s ease forwards;
}

    .result-item:nth-child(1) {
        animation-delay: 0.05s;
    }

    .result-item:nth-child(2) {
        animation-delay: 0.1s;
    }

    .result-item:nth-child(3) {
        animation-delay: 0.15s;
    }

    .result-item:nth-child(4) {
        animation-delay: 0.2s;
    }

    .result-item:nth-child(5) {
        animation-delay: 0.25s;
    }
