/* ============================================
   SEARCH DROPDOWN + RESULT ROWS (shared by dropdown & search.php)
   ============================================ */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.18), 0 4px 16px -4px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border, #E2E8E4);
    max-height: 70vh;
    overflow-y: auto;
    animation: searchDropdownIn 0.15s ease-out;
}
@keyframes searchDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-section-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748B);
    padding: 0.9rem 1.1rem 0.4rem;
}

.search-result-list { display: flex; flex-direction: column; }

.search-result-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.search-result-row:hover,
.search-result-row:focus-visible {
    background: var(--bg-surface, #F1F5F2);
}

.search-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary, linear-gradient(135deg, #00A878 0%, #34D399 100%));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -2px rgba(0, 168, 120, 0.4);
}

.search-row-info { display: flex; flex-direction: column; min-width: 0; gap: 0.15rem; }
.search-row-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark, #0F172A);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-row-title mark {
    background: var(--primary-light, #D1FAE5);
    color: var(--primary-dark, #065F46);
    padding: 0 3px;
    border-radius: 4px;
    font-weight: 800;
}
.search-row-category {
    font-size: 0.78rem;
    color: var(--text-muted, #64748B);
}

.search-suggestions { border-bottom: 1px solid var(--border, #E2E8E4); padding-bottom: 0.5rem; }
.search-suggestion-item {
    display: block;
    padding: 0.55rem 1.1rem;
    color: var(--text-muted, #64748B);
    text-decoration: none;
    font-size: 0.88rem;
}
.search-suggestion-item:hover { color: var(--primary, #00A878); }

.search-view-all {
    display: block;
    text-align: center;
    padding: 0.9rem;
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--primary, #00A878);
    text-decoration: none;
    border-top: 1px solid var(--border, #E2E8E4);
}
.search-view-all:hover { background: var(--primary-light, #D1FAE5); }

.search-loading, .search-error, .search-empty {
    padding: 1.5rem 1.1rem;
    text-align: center;
    color: var(--text-muted, #64748B);
    font-size: 0.9rem;
}


/* --- Restores the search box pill border, lost when search.css was
       fully replaced earlier --- */
.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border: 2px solid var(--primary, #00A878);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 16px -4px rgba(0, 168, 120, 0.15);
    gap: 0.5rem;
    padding: 0.3rem 0.3rem 0.3rem 1.1rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-box:focus-within {
    box-shadow: 0 10px 28px -6px rgba(0, 168, 120, 0.3);
    border-color: var(--primary-dark, #065F46);
}

/* Centers and bounds the whole search bar - was previously only set via
   an inline style on index.php's markup, which also meant no responsive
   adjustment at all on small screens. */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
}

.search-input-pill {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}
.search-input-pill input,
#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.75rem 0.25rem;
    background: transparent;
    width: 100%;
    min-width: 0;
    color: var(--text-dark, #0F172A);
}
.search-input-pill input::placeholder,
#search-input::placeholder {
    color: #94A3B8;
}

/* Previously only existed as inline styles directly on the button in
   index.php - meaning this had zero real CSS backing anywhere at all.
   No hover scale here deliberately: .search-box above has
   overflow:hidden, and a scaled button could clip against its rounded
   corner. */
.btn-search {
    background: var(--gradient-primary, linear-gradient(135deg, #00A878 0%, #3ECF8E 100%));
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.btn-search svg { display: block; }

@media (max-width: 480px) {
    .search-container { margin: 1.5rem auto; }
    .btn-search { width: 42px; height: 42px; }
    .search-input-pill input,
    #search-input { padding: 0.65rem 0.25rem; font-size: 0.95rem; }
}
