/* ============================================================
   GIFEC SEARCH STYLES
   Import on every page: <link rel="stylesheet" href="search.css">
   ============================================================ */

/* ── HEADER SEARCH WRAPPER ──────────────────────────────────── */
.header-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1001;
}

/* The "Search" trigger button (default visible state) */
.header-search-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.header-search-trigger:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.header-search-trigger i {
    font-size: 12px;
    margin-right: 0;
}

/* The sliding search bar (hidden by default) */
.header-search-bar {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.header-search-bar.active {
    width: 260px;
    opacity: 1;
    pointer-events: all;
}

.header-search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 6px 12px;
    min-width: 0;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.header-search-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.header-search-close:hover {
    color: white;
}

/* ── HEADER SEARCH DROPDOWN ─────────────────────────────────── */
.header-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    z-index: 1200;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

.header-search-dropdown.active {
    display: block;
}

/* Individual result item */
.search-result-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f8ff;
}

.search-result-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #003f87;
    flex-grow: 1;
    line-height: 1.3;
}

/* Highlight matched text in results */
.search-result-title mark {
    background-color: #fff3cd;
    color: #003f87;
    border-radius: 2px;
    padding: 0 1px;
}

.search-result-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.search-result-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    /* -webkit-line-clamp: 2; */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-no-results {
    padding: 20px 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ── NEWS PAGE SEARCH ────────────────────────────────────────── */
/* No results message on news page */
.news-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #888;
    gap: 16px;
}

.news-no-results i {
    font-size: 48px;
    color: #ddd;
}

.news-no-results p {
    font-size: 16px;
    margin: 0;
}

.news-no-results span {
    color: #003f87;
    font-weight: 600;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-search-bar.active {
        width: 200px;
    }

    /* On mobile, dropdown spans full screen width */
    .header-search-dropdown {
        position: fixed;
        top: 44px; /* height of top-header */
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .header-search-label {
        display: none; /* Show icon only on very small screens */
    }

    .header-search-bar.active {
        width: 160px;
    }

    .header-search-dropdown {
          position: fixed;
        top: 44px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        max-height: 60vh;
    }
    
}
