/* ===== SEARCH MODAL ===== */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: min(20vh, 160px);
}

.search-modal.active {
    display: flex;
}

.search-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay-medium);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    width: 95%;
    max-width: 640px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: searchSlideIn 0.2s ease-out;
}

@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header avec input */
.search-modal-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
}

.search-modal-header svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.search-modal-header input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--text-lg);
    color: var(--text);
    font-family: inherit;
}

.search-modal-header input::placeholder {
    color: var(--text-muted);
}

.search-modal-header kbd {
    font-size: var(--text-xs);
    padding: var(--sp-1) var(--sp-1);
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: inherit;
}

/* Résultats */
.search-modal-results {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--sp-2);
}

.search-result-item {
    display: block;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: background-color var(--ease-fast);
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-alt);
}

.search-result-top {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-1);
}

.search-badge {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-sm);
}

.search-badge-tuto {
    background: var(--cat-linux-bg);
    color: var(--color-cat-linux);
}

.search-badge-blog {
    background: var(--primary-bg-light);
    color: var(--primary);
}

.search-category {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.search-result-title {
    font-weight: var(--weight-semibold);
    font-size: var(--text-base);
    line-height: 1.4;
}

.search-result-excerpt {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: var(--sp-1);
}

.search-empty {
    text-align: center;
    padding: var(--sp-10) var(--sp-5);
    color: var(--text-secondary);
}

.search-empty p {
    margin-top: var(--sp-2);
    font-size: var(--text-sm);
}

/* Footer */
.search-modal-footer {
    display: flex;
    gap: var(--sp-4);
    padding: var(--sp-2) var(--sp-5);
    border-top: 1px solid var(--border);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.search-modal-footer kbd {
    font-size: var(--text-xs);
    padding: var(--sp-1) var(--sp-1);
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    margin-right: var(--sp-1);
}

/* Bouton navbar */
.search-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--ease-base), background-color var(--ease-base);
}

.search-toggle-btn:hover {
    color: var(--primary);
    background-color: var(--primary-bg-subtle);
}

.search-toggle-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Dark mode */
html[data-theme="dark"] .search-modal-backdrop {
    background: var(--overlay-medium);
}

html[data-theme="dark"] .search-modal-content {
    box-shadow: var(--shadow-xl);
}

html[data-theme="dark"] .search-result-item:hover,
html[data-theme="dark"] .search-result-item.selected {
    background: var(--card-hover);
}

/* Responsive */
@media (max-width: 640px) {
    .search-modal {
        padding-top: 0;
        align-items: stretch;
    }

    .search-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
        height: 100dvh;
    }

    .search-modal-results {
        max-height: calc(100vh - 120px);
        max-height: calc(100dvh - 120px);
    }

    .search-modal-footer {
        display: none;
    }
}

/* ===== FEEDBACK COMPONENT ===== */
.feedback-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-6);
    margin: var(--sp-8) 0;
    border-radius: var(--radius-lg);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    text-align: center;
}

.feedback-question {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text);
}

.feedback-buttons {
    display: flex;
    gap: var(--sp-3);
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--ease-base);
    font-family: inherit;
}

.feedback-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg-subtle);
}

.feedback-btn.active {
    border-color: var(--primary);
    background: var(--primary-bg-light);
    color: var(--primary);
    font-weight: var(--weight-semibold);
}

.feedback-btn svg {
    width: 18px;
    height: 18px;
}

.feedback-count {
    font-size: var(--text-sm);
    opacity: 0.7;
}

.feedback-widget.voted .feedback-btn:not(.active) {
    opacity: 0.4;
    cursor: default;
}

.feedback-thanks {
    display: none;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.feedback-widget.voted .feedback-thanks {
    display: block;
}
