/* Global Search Bar Styles extracted from index.php */

.search-row {
    padding: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-color, #fff);
    transition: box-shadow 0.3s;
}

.search-row.is-sticky {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.search-wrapper {
    flex: 1;
    background: #F3F4F6;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1001;
    /* Prevent wrapper from expanding when suggestions appear */
    overflow: visible;
}

.search-wrapper i.fa-search {
    color: #9CA3AF;
    font-size: 18px;
}

.search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 15px;
    color: #111827;
}

/* Voice Mic */
.voice-mic {
    color: #6B7280;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.voice-mic.recording {
    color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.filter-btn-square {
    width: 52px;
    height: 52px;
    background: #F3F4F6;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: #111827;
    font-size: 18px;
}

/* Overlay */
.search-overlay,
.global-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s;
}

.search-overlay.active,
.global-search-overlay.active {
    display: block;
}

/* Dark Mode Support */
body.dark-mode .search-row {
    background: var(--bg-color, #111827);
}

body.dark-mode .search-wrapper,
body.dark-mode .filter-btn-square {
    background: #374151;
}

body.dark-mode .search-wrapper input {
    color: #F9FAFB;
}

body.dark-mode .filter-btn-square {
    color: #F9FAFB;
}

/* =====================================================
   SEARCH SUGGESTIONS — Absolute dropdown below bar
   Prevents bar from expanding when results appear
   ===================================================== */
.search-suggestions {
    position: absolute !important;
    top: 100% !important;
    /* Start just below search-wrapper */
    left: 0 !important;
    right: 0 !important;
    margin-top: 6px !important;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999 !important;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    /* Never affect the parent height */
    height: auto;
}

.search-suggestions:empty {
    display: none;
}

body.dark-mode .search-suggestions {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}