/* ==============================================
   SEARCH WRAPPER
=============================================== */

.search-wrapper {
    position: relative;
    width: 420px;
}

/* ==============================================
   SEARCH PILL (input bar)
=============================================== */

.search-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #1f2933, #111827);
    padding: 10px 16px;
    border-radius: 14px;
    width: 100%;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.search-pill:focus-within {
    border-color: #22c55e;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.15);
}

.search-icon {
    color: #9ca3af;
    font-size: 15px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-pill:focus-within .search-icon {
    color: #22c55e;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #e5e7eb;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-clear {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.search-clear:hover {
    color: #e5e7eb;
}

/* ==============================================
   DROPDOWN PANEL
=============================================== */

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 420px;
    background: #1e2633;
    border: 1px solid #2d3748;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    overflow: hidden;
}

/* ==============================================
   FILTER TABS
=============================================== */

.search-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 12px 6px;
    border-bottom: 1px solid #2d3748;
}

.search-tab {
    background: transparent;
    border: 1px solid #374151;
    border-radius: 20px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

.search-tab:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.search-tab.active {
    background: #22c55e;
    border-color: #22c55e;
    color: #000000;
}

/* ==============================================
   RESULTS CONTAINER
=============================================== */

.search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 6px 0 8px;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 2px;
}

/* ==============================================
   SECTION LABEL (Suggested / Teams / etc.)
=============================================== */

.search-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 14px 4px;
}

/* ==============================================
   RESULT ROW
=============================================== */

.search-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
}

.search-result-row:hover,
.search-result-row.keyboard-active,
.search-result-row.keyboard-selected {
    background: #263044;
}

/* Logo / Icon container */
.search-result-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2d3748;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.search-result-logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.search-result-logo .fallback-icon {
    font-size: 15px;
    color: #6b7280;
}

/* Text block */
.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.search-result-flag {
    width: 14px;
    height: 10px;
    object-fit: cover;
    border-radius: 1px;
    flex-shrink: 0;
}

.search-result-country {
    font-size: 11px;
    color: #9ca3af;
}

.search-result-type-badge {
    font-size: 11px;
    color: #6b7280;
}

/* Score badge for fixtures */
.search-result-score {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    background: #374151;
    border-radius: 4px;
    padding: 2px 7px;
    flex-shrink: 0;
}

.search-result-score.live {
    background: #dc2626;
    color: #fff;
}

/* Fixture specific — two team logos side by side */
.search-fixture-logos {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.search-fixture-logos img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.search-fixture-vs {
    font-size: 10px;
    color: #6b7280;
    font-weight: 700;
}

.search-query-icon {
    color: #9ca3af;
    font-size: 12px;
    flex-shrink: 0;
}

/* ==============================================
   EMPTY / LOADING STATES
=============================================== */

.search-empty {
    padding: 24px 14px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 14px;
    color: #9ca3af;
    font-size: 13px;
}

.search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #374151;
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Dropdown hidden by default, shown via .open class toggled by JS */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 420px;
    background: #1e2633;
    border: 1px solid #2d3748;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    overflow: hidden;
}

.search-dropdown.open {
    display: block;
}

/* ==============================================
   DARK MODE OVERRIDES
   (these are always dark — the pill is always
   dark regardless of page theme, matching
   Sofascore's approach)
=============================================== */

/* Light mode page — pill stays dark, no override needed */
/* Dark mode page — same dark pill, also no override needed */
