/* Header-Button-Reihe — Suche, Ton, Konto.
 *
 * EIGENE Datei, damit die Buttons auch auf Seiten ohne .main-header
 * funktionieren (Séance) und nicht ueber style.css erzwungen werden
 * muessen. style.css laedt nur auf Seiten mit Standard-Header.
 *
 * Klasse fuer Klasse identisch zu style.css (Zeilen 720-957) —
 * style.css laedt weiterhin zuerst, diese Datei ueberschreibt nur,
 * was fuer die Button-Reihe noetig ist.
 */

/* --- Container ------------------------------------------------------- */
.header-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    z-index: 10;
}

/* Seiten ohne Standard-Header (Séance): der Container ist dann fixed
   oben rechts, weil es keinen .main-header zum Verankern gibt. */
body:not(:has(.main-header)) .header-actions {
    position: fixed;
    z-index: 45;
}

/* In der Reihe sind die Buttons statisch (der Container positioniert). */
.header-actions .search-button,
.header-actions .sound-button,
.header-actions .mv-account-pill { position: static; }

/* Reihenfolge in der Header-Reihe: Suche, Ton, Konto.
   Fest per CSS, damit sie nicht von der Reihenfolge des Einfuegens
   (Such-/Ton-/Konto-Script) abhaengt. */
.header-actions .search-button { order: 1; }
.header-actions .sound-button { order: 2; }
.header-actions .mv-account-pill { order: 3; }

/* --- Ton-Button ------------------------------------------------------ */
.sound-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(212, 169, 68, 0.15);
    border: 1px solid rgba(212, 169, 68, 0.3);
    color: var(--color-gold, #d4a944);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-family: var(--font-body, 'Crimson Text', Georgia, serif);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}
.sound-button:hover { background: rgba(212, 169, 68, 0.3); }
.sound-button .sound-icon { font-size: 1rem; }

/* --- Such-Button ----------------------------------------------------- */
.search-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(212, 169, 68, 0.15);
    border: 1px solid rgba(212, 169, 68, 0.3);
    color: var(--color-gold, #d4a944);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-family: var(--font-body, 'Crimson Text', Georgia, serif);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}
.search-button:hover {
    background: rgba(212, 169, 68, 0.25);
    border-color: var(--color-gold, #d4a944);
}
.search-icon { font-size: 1.1rem; }
.search-text { display: none; }

/* --- Such-Overlay ---------------------------------------------------- */
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 13, 26, 0.95);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.search-overlay.active { opacity: 1; visibility: visible; }

.search-container {
    width: 100%;
    max-width: 600px;
    background: var(--color-bg-card, #1a1a35);
    border-radius: 1rem;
    border: 1px solid rgba(212, 169, 68, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.search-header { display: flex; border-bottom: 1px solid rgba(212, 169, 68, 0.15); }
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.25rem 1.5rem;
    color: var(--color-text, #e8e6f0);
    font-family: var(--font-body, 'Crimson Text', Georgia, serif);
    font-size: 1.1rem;
    outline: none;
}
.search-input::placeholder { color: var(--color-text-muted, #9590a8); }
.search-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted, #9590a8);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}
.search-close:hover { color: var(--color-gold, #d4a944); }
.search-results { max-height: 60vh; overflow-y: auto; }
.search-hint,
.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted, #9590a8);
}
.search-results-list { list-style: none; margin: 0; padding: 0; }
.search-result-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}
.search-result-item a:hover { background: rgba(212, 169, 68, 0.1); }
.search-result-name { color: var(--color-text, #e8e6f0); font-weight: 600; }
.search-result-deck { color: var(--color-text-muted, #9590a8); font-size: 0.85rem; }
.search-result-item[data-deck="thoth"] .search-result-deck { color: var(--color-thoth, #7b2d8c); }
.search-result-item[data-deck="waite"] .search-result-deck { color: var(--color-waite, #2d5c8c); }
.search-result-item[data-deck="marseille"] .search-result-deck { color: var(--color-marseille, #8c7b2d); }
.search-result-item[data-deck="lenormand"] .search-result-deck { color: var(--color-lenormand, #8c2d4c); }
.search-result-item[data-deck="spread"] .search-result-deck { color: var(--color-gold, #d4a944); }

/* --- Responsive ------------------------------------------------------ */
@media (min-width: 600px) {
    .search-text { display: inline; }
    .search-button { padding: 0.5rem 1.25rem; }
}
