/* 
 * Global Search CSS - Modern & Clean
 */

:root {
    --search-bg: #1a1a1a;
    --search-accent: #00a8ff;
    --search-text: #e0e0e0;
    --search-text-dim: #a0a0a0;
    --search-border: #333;
    --search-hover: #252525;
    --search-highlight: rgba(0, 168, 255, 0.2);
}

/* Header Input Styling */
#global-search-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--search-border);
    background: #222;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#global-search-input:hover {
    border-color: var(--search-accent);
    background: #2a2a2a;
}

/* Overlay / Modal */
#global-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    /* Doit passer au-dessus du header fixe */
    z-index: 2147483648 !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#global-search-overlay.active {
    display: flex;
    opacity: 1;
}

.global-search-panel {
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    width: 700px;
    max-width: 95%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal Header */
.search-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--search-border);
    position: relative;
}

.close-search {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--search-text-dim);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s;
}

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

#modal-search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    outline: none;
    padding: 10px 0;
}

/* Filters */
.site-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--search-border);
}

.site-filters label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--search-text-dim);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.site-filters label:hover {
    color: white;
}

.site-filters input[type="checkbox"] {
    accent-color: var(--search-accent);
}

/* Results Area */
.results-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

#global-search-results {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-result-item {
    border-bottom: 1px solid var(--search-border);
    transition: background 0.2s;
}

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

.search-result-item:hover {
    background: var(--search-hover);
}

.result-link {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: inherit;
}

.result-site-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--search-accent);
    margin-bottom: 4px;
    font-weight: bold;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 6px;
}

.result-excerpt {
    font-size: 14px;
    color: var(--search-text-dim);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

mark {
    background: var(--search-highlight);
    color: var(--search-accent);
    padding: 0 2px;
    border-radius: 2px;
}

.search-info {
    padding: 40px 20px;
    text-align: center;
    color: var(--search-text-dim);
    font-style: italic;
}

#search-status {
    font-size: 12px;
    color: var(--search-accent);
    height: 15px;
    margin-top: 5px;
}

/* Custom Scrollbar */
.results-container::-webkit-scrollbar {
    width: 8px;
}

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

.results-container::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #444;
}
