@import url('./design-tokens.css');
/* ============================================
   TOPBAR QUICK SEARCH
   ============================================ */

/* Close-Button Styling für Search-Window */
#search-close-btn.close-btn {
    background: var(--glass-bg-subtle);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    margin: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#search-close-btn.close-btn:hover {
    background: var(--color-error);
    color: var(--text-primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow-error);
}

/* Treffer-Badge im Header */
.results-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.25), rgba(var(--color-purple-rgb), 0.2));
    border: 1px solid rgba(var(--color-primary-light-rgb), 0.4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-primary-light);
    min-width: 30px;
    box-shadow: 0 0 15px rgba(var(--color-primary-light-rgb), 0.3);
    animation: badgePulse 0.3s ease;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#search-container.base-window .brain-header {
    flex-shrink: 0;
    padding: 0; /* Kein zusätzliches Padding - wie Brain-Window */
    /* Kopiere alle visuellen Eigenschaften aus brain.css */
    display: flex;
    align-items: center;
    margin: 0;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.2), rgba(var(--color-purple-rgb), 0.2));
    border-bottom: 1px solid rgba(var(--color-primary-light-rgb), 0.5);
    font-weight: var(--weight-bold);
    font-size: var(--text-sm);
    box-shadow:
        0 0 10px rgba(var(--color-primary-rgb), 0.5),
        inset 0 0 10px rgba(var(--color-primary-rgb), 0.3);
    text-shadow: 0 0 5px rgba(var(--color-primary-light-rgb), 0.8);
    mix-blend-mode: screen;
    position: relative;
    overflow: hidden;
    height: 34px; /* Feste Höhe */
}

/* Shimmer Animation für Header */
#search-container.base-window .brain-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 15s infinite linear;
}

#search-container.base-window .brain-header:hover {
    box-shadow:
        0 0 20px rgba(var(--color-primary-rgb), 0.8),
        inset 0 0 15px rgba(var(--color-primary-rgb), 0.5);
}

/* Header-Title Padding wie Brain-Window */
#search-container.base-window .header-title {
    padding-left: 10px; /* Konsistent mit brain.css */
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-align: left;
    margin-right: auto;
}

#search-container.base-window .brain-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Ensure content doesn't overflow */
#search-container.base-window .brain-content > * {
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0; /* Kein Margin für erste Child-Elemente */
}

/* Smooth show animation */
#search-container.base-window[style*="display: flex"],
#search-container.base-window[style*="display: block"] {
    animation: searchSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========== SEARCH CONTENT AREA ========== */
.search-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========== SEARCH PARAMETERS SECTION ========== */
.search-input-wrapper {
    display: grid;
    grid-template-columns: 1fr auto auto; /* Input + search + clear */
    align-items: start; /* Oben ausrichten statt center */
    gap: var(--spacing-sm);
    padding: 8px 16px 12px 16px; /* Leichtes Padding für Inputs, aber eng am Header */
    margin-top: 0;
    /* Visuell abgesetzter Bereich für Suchparameter */
    background: transparent; /* Entfernt für cleanes Design wie andere Fenster */
    border-bottom: 1px solid var(--glass-border); /* Subtilere Border */
    position: relative;
}

/* Visuellen Indikator entfernt für konsistentes Design */

/* Search Mode Selector - Positioned below input as compact checkboxes */
.search-mode-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 16px;
    background: rgba(var(--color-secondary-rgb), 0.1);
    border-bottom: 1px solid var(--glass-border);
}

.search-options-divider {
    width: 1px;
    height: 14px;
    background: var(--glass-border);
    margin: 0 8px;
}

.mode-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    transition: color var(--transition-fast) ease;
    user-select: none;
}

.mode-checkbox:hover {
    color: var(--text-primary);
}

.mode-checkbox input[type="radio"],
.mode-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-xs);
    background: var(--glass-bg-subtle);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    position: relative;
}

.mode-checkbox input[type="radio"]:hover,
.mode-checkbox input[type="checkbox"]:hover {
    border-color: rgba(var(--color-primary-light-rgb), 0.5);
    background: rgba(var(--color-secondary-rgb), 0.08);
}

.mode-checkbox input[type="radio"]:checked,
.mode-checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.3), rgba(var(--color-purple-rgb), 0.2));
    border-color: var(--color-primary-light);
    box-shadow: 0 0 8px rgba(var(--color-primary-light-rgb), 0.3);
}

.mode-checkbox input[type="radio"]:checked::after,
.mode-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-primary-light);
    font-size: 10px;
    font-weight: var(--weight-bold);
}

.mode-checkbox input[type="radio"]:checked + span,
.mode-checkbox input[type="checkbox"]:checked + span {
    color: var(--color-primary-light);
    font-weight: var(--weight-medium);
}

/* Legacy - old styles */
.mode-btn,
.search-options,
.search-option-checkbox {
    display: none;
}

#search-input {
    /* Nimmt den gesamten verfügbaren Platz */
    width: 100%;
    min-width: 240px; /* Reduziert: 300px → 240px (ca. 20% kleiner) */
    background: rgba(var(--color-secondary-rgb), 0.15);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 14px; /* Reduziert: 14px 18px → 12px 14px */
    margin: 0; /* Kein Margin - wichtig für konsistenten Abstand */
    color: var(--text-primary);
    font-size: var(--text-sm); /* Reduziert: 15px → 14px */
    line-height: 1.4; /* Reduziert: 1.5 → 1.4 */
    outline: none;
    transition: all var(--transition-normal) ease;
    box-sizing: border-box;
}

#search-input:focus {
    background: rgba(var(--color-secondary-rgb), 0.25);
    border-color: rgba(var(--color-primary-light-rgb), 0.5);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-light-rgb), 0.1),
                0 0 20px rgba(var(--color-primary-light-rgb), 0.15) inset;
}

#search-input::placeholder {
    color: rgba(var(--color-primary-light-rgb), 0.6); /* Helleres Blau mit höherer Opacity für bessere Lesbarkeit */
    font-weight: var(--weight-normal);
}

.search-options {
    display: flex;
    gap: 6px;
}

.search-option-checkbox {
    display: flex;
    align-items: center;
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    user-select: none;
}

.search-option-checkbox:hover {
    background: rgba(var(--color-secondary-rgb), 0.08);
}

.search-option-checkbox input[type="checkbox"] {
    display: none;
}

.search-option-checkbox span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: var(--weight-semibold);
    transition: color var(--transition-fast) ease;
}

.search-option-checkbox input[type="checkbox"]:checked + span {
    color: var(--color-primary-light);
}

.search-action-btn {
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.15), rgba(var(--color-purple-rgb), 0.1));
    border: 1px solid rgba(var(--color-primary-light-rgb), 0.3);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--color-primary-light);
    cursor: pointer;
    transition: all var(--transition-normal) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.search-action-btn:hover {
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.25), rgba(var(--color-purple-rgb), 0.15));
    box-shadow: var(--shadow-glow-primary-subtle);
    transform: translateY(-1px);
}

.search-action-btn.clear {
    background: rgba(var(--color-error-rgb), 0.1);
    border-color: rgba(var(--color-error-rgb), 0.3);
    color: var(--color-error-light);
    width: 36px; /* Etwas kleiner damit er nicht rausragt */
    height: 36px;
    padding: 8px 10px;
}

.search-action-btn.clear:hover {
    background: rgba(var(--color-error-rgb), 0.2);
    box-shadow: var(--shadow-glow-error-subtle);
}

/* ========== FILTERS & SORT SECTION ========== */
.search-filters {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 16px;
    /* Visuell abgesetzter Bereich für Filter & Sort */
    background: linear-gradient(135deg, rgba(var(--color-purple-rgb), 0.08), rgba(var(--color-primary-rgb), 0.05));
    border-top: 1px solid rgba(var(--color-purple-rgb), 0.15);
    border-bottom: 1px solid rgba(var(--color-purple-rgb), 0.15);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    color: var(--text-muted);
    font-size: 9px; /* Kleiner: 10px→9px */
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.filter-toggle-btn:hover,
.filter-toggle-btn.active {
    background: rgba(var(--color-primary-light-rgb), 0.15);
    border-color: rgba(var(--color-primary-light-rgb), 0.4);
    color: var(--color-primary-light);
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.15), rgba(var(--color-purple-rgb), 0.1));
    border: 1px solid rgba(var(--color-primary-light-rgb), 0.3);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 12px;
    color: var(--color-primary-light);
    animation: chipSlideIn 0.2s ease;
}

@keyframes chipSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-chip-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast) ease;
}

.filter-chip-remove:hover {
    color: var(--color-error-light);
}

.search-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.search-sort label {
    font-weight: var(--weight-medium);
}

#search-sort-select {
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast) ease;
}

#search-sort-select:hover,
#search-sort-select:focus {
    background: rgba(var(--color-secondary-rgb), 0.08);
    border-color: rgba(var(--color-primary-light-rgb), 0.4);
}

/* Dropdown-Optionen Styling */
#search-sort-select option {
    background: var(--color-bg-darker);
    color: var(--text-primary);
    padding: 8px;
}

#search-sort-select option:hover,
#search-sort-select option:checked {
    background: rgba(var(--color-primary-light-rgb), 0.2);
    color: var(--color-primary-light);
}

/* ========== FILTER PANEL (EXPANDED) ========== */
.filter-panel {
    padding: 8px 10px;
    /* Visuell eingerückter/abgesetzter Bereich für erweiterte Filter */
    background: linear-gradient(135deg, rgba(var(--color-bg-dark-rgb), 0.4), rgba(var(--color-bg-darker-rgb), 0.3));
    border-top: 1px solid rgba(var(--color-purple-rgb), 0.2);
    border-bottom: 2px solid rgba(var(--color-purple-rgb), 0.25);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.03);
    animation: panelSlideDown 0.3s ease;
    position: relative;
}

/* Label für Filter-Panel */
.filter-panel::before {
    content: 'FILTERS';
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(var(--color-purple-rgb), 0.5);
    margin-bottom: 6px;
    text-transform: uppercase;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(var(--color-purple-rgb), 0.15);
}

@keyframes panelSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

.filter-section {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 0;
    vertical-align: middle;
    white-space: nowrap;
}

.filter-section:last-child {
    margin-right: 0;
}

.filter-section label {
    display: inline-block;
    font-size: 7px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 0;
    margin-right: 3px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

.filter-buttons {
    display: inline-flex;
    gap: 3px; /* Etwas mehr Abstand */
    flex-wrap: nowrap;
    vertical-align: middle;
}

.filter-btn {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: 3px; /* Etwas größerer Radius */
    padding: 2px 6px !important; /* Größer: 1px→2px, 4px→6px */
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px !important; /* Größer: 10px→11px */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.1 !important; /* Etwas mehr Höhe */
    min-width: auto;
    height: auto !important;
    width: auto !important;
}

.filter-btn:hover {
    background: var(--glass-bg-light);
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(121, 211, 255, 0.25), rgba(156, 123, 255, 0.2));
    border-color: rgba(121, 211, 255, 0.5);
    color: #79d3ff;
    box-shadow: 0 0 4px rgba(121, 211, 255, 0.2);
    font-weight: 600;
}

/* ========== RESULTS DROPDOWN SECTION ========== */
.search-results-dropdown {
    max-height: 400px;
    overflow-y: auto;
    /* Visuell abgesetzter Bereich für Results */
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.3), rgba(0, 20, 50, 0.2));
    border-top: 2px solid rgba(0, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 -1px 0 rgba(255, 255, 255, 0.05);
    animation: dropdownSlideDown 0.3s ease;
    position: relative;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    /* Header innerhalb des Results-Bereichs */
    background: linear-gradient(135deg, rgba(0, 100, 150, 0.25), rgba(0, 50, 100, 0.15));
    border-bottom: 2px solid rgba(0, 255, 255, 0.25);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

#search-results-count {
    font-size: 13px;
    font-weight: 600;
    color: rgba(121, 211, 255, 1);
    letter-spacing: 0.3px;
    /* Dezente Anzeige - sichtbar aber nicht dominant */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    display: inline-block;
}

.results-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.camera-nav-btn {
    background: rgba(121, 211, 255, 0.1);
    border: 1px solid rgba(121, 211, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    color: #79d3ff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-nav-btn:hover:not(:disabled) {
    background: rgba(121, 211, 255, 0.2);
    box-shadow: 0 0 12px rgba(121, 211, 255, 0.3);
}

.camera-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(121, 211, 255, 0.15);
}

.results-zoom-all {
    background: rgba(121, 211, 255, 0.1);
    border: 1px solid rgba(121, 211, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    color: #79d3ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.results-zoom-all:hover {
    background: rgba(121, 211, 255, 0.2);
    box-shadow: 0 0 12px rgba(121, 211, 255, 0.3);
}

.results-list {
    padding: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px;
    /* Einzelne Result-Items mit subtiler Abgrenzung */
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.15), rgba(0, 30, 70, 0.1));
    border: 1px solid rgba(0, 255, 255, 0.12);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: resultFadeIn 0.3s ease backwards;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }
.result-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item:hover,
.result-item.selected {
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.12), rgba(var(--color-purple-rgb), 0.08));
    border-color: rgba(var(--color-primary-light-rgb), 0.4);
    transform: translateX(4px);
    box-shadow: var(--shadow-glow-primary-subtle);
}

.result-level-badge {
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(var(--color-primary-light-rgb), 0.2), rgba(var(--color-purple-rgb), 0.15));
    border: 1px solid rgba(var(--color-primary-light-rgb), 0.3);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: var(--weight-bold);
    color: var(--color-primary-light);
}

.result-info {
    flex: 1;
    overflow: hidden;
}

.result-name {
    font-size: 14px;
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-name .highlight {
    background: rgba(var(--color-warning-rgb), 0.3);
    color: var(--color-warning-light);
    padding: 1px 3px;
    border-radius: var(--radius-xs);
}

.result-meta {
    display: flex;
    gap: var(--space-3);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.result-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.result-actions {
    display: flex;
    gap: var(--spacing-xs); /* Kompakter Abstand zwischen Buttons */
}

.result-edit-btn,
.result-zoom-btn,
.result-action-btn {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-edit-btn:hover {
    background: rgba(255, 191, 0, 0.15);
    border-color: rgba(255, 191, 0, 0.4);
    color: #ffbf00;
}

.result-zoom-btn:hover,
.result-action-btn:hover {
    background: rgba(121, 211, 255, 0.15);
    border-color: rgba(121, 211, 255, 0.4);
    color: #79d3ff;
}

/* ========== SEARCH HISTORY ========== */
.search-history {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 200px;
    overflow-y: auto;
}

.history-header {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.history-item {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: var(--glass-bg-light);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(121, 211, 255, 0.3);
}

/* ========== SCROLLBAR ========== */
.search-results-dropdown::-webkit-scrollbar,


.search-results-dropdown::-webkit-scrollbar-track,
.search-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.search-results-dropdown::-webkit-scrollbar-thumb,
.search-history::-webkit-scrollbar-thumb {
    background: rgba(121, 211, 255, 0.3);
    border-radius: var(--radius-xs);
}

.search-results-dropdown::-webkit-scrollbar-thumb:hover,
.search-history::-webkit-scrollbar-thumb:hover {
    background: rgba(121, 211, 255, 0.5);
}

/* ========== RESPONSIVE ========== */
@media (min-width: 769px) {
    #search-container.base-window {
        width: 420px !important; /* Fixe Breite für große Bildschirme */
        max-width: 420px;
    }
}

@media (max-width: 768px) {
    #search-container.base-window {
        width: calc(100vw - 40px);
        max-width: 420px;
        top: 60px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    #search-container.base-window {
        width: calc(100vw - 20px);
        right: 10px;
        top: 50px;
    }

    .search-input-wrapper {
        flex-wrap: wrap;
    }

    .search-mode-selector {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    #search-input {
        order: 1;
        width: 100%;
    }

    .search-options {
        order: 2;
    }

    .search-filters {
        flex-wrap: wrap;
    }

    .filter-chips {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }
}

/* ========== TOAST ANIMATIONS ========== */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ========== CUSTOM SCROLLBAR FOR SEARCH ========== */

#search-container .brain-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#search-container .brain-content::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 255, 0.5);
    border-radius: var(--radius-xs);
}

#search-container .brain-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 191, 255, 0.7);
}

/* ============================================
   TOPBAR SEARCH — SPOTLIGHT TRIGGER + PANEL
   ============================================ */

/* --- Trigger Button (in Topbar) --- */

.topbar-search-wrapper {
    position: relative;
    flex-shrink: 0;
}

.topbar-search-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans, sans-serif);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    position: relative;
    z-index: 5;
    pointer-events: auto !important;
}

.topbar-search-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

.topbar-search-trigger:active {
    transform: scale(0.97);
}

.topbar-search-trigger svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.topbar-search-trigger:hover svg {
    opacity: 0.9;
}

.topbar-search-trigger-label {
    font-weight: 400;
}

.topbar-search-trigger-kbd {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
    line-height: 1.3;
}

/* --- Backdrop (dim overlay behind panel) --- */

.topbar-search-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: calc(var(--z-max, 100000) - 2);
    animation: spotlightBackdropIn 0.2s ease;
}

@keyframes spotlightBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Spotlight Panel (Overlay) --- */

.topbar-search-dropdown {
    position: fixed;
    width: 560px;
    max-width: calc(100vw - 32px);
    background: rgba(12, 18, 30, 0.95);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.65),
        0 0 1px rgba(255, 255, 255, 0.15),
        0 0 60px rgba(var(--color-primary-rgb), 0.06);
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: calc(var(--z-max, 100000) - 1);
    animation: spotlightSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Panel Header (embedded search input) --- */

.topbar-search-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.topbar-search-panel-icon {
    color: rgba(var(--color-primary-rgb), 0.6);
    flex-shrink: 0;
    opacity: 0.8;
}

.topbar-search-panel-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    font-family: var(--font-sans, sans-serif);
    font-weight: 400;
    padding: 0;
    caret-color: rgba(var(--color-primary-rgb), 0.8);
}

.topbar-search-panel-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

.topbar-search-panel-kbd {
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
    flex-shrink: 0;
}

/* Clear Button (inside panel header) */
.topbar-search-clear-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar-search-clear-btn:hover {
    background: rgba(255, 77, 77, 0.2);
    border-color: rgba(255, 77, 77, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

/* --- Results Container --- */

.topbar-search-results {
    flex: 1;
    max-height: calc(70vh - 100px);
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

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

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

.topbar-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.topbar-search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   SPOTLIGHT SECTIONS
   ============================================ */

.spotlight-section {
    margin-bottom: 4px;
}

.spotlight-section:last-child {
    margin-bottom: 0;
}

.spotlight-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
    user-select: none;
}

.spotlight-section-icon {
    font-size: 11px;
}

.spotlight-section-count {
    margin-left: auto;
    font-size: 9px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

/* ============================================
   SPOTLIGHT RESULT ITEMS
   ============================================ */

.spotlight-result-item {
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    margin: 1px 0;
    position: relative;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
    background: rgba(255, 255, 255, 0.06);
}

.spotlight-result-item.selected {
    background: rgba(var(--color-primary-rgb), 0.1);
}

.spotlight-result-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: 1px;
    background: var(--color-primary-light);
}

.spotlight-result-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spotlight-result-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-result-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
    padding-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.spotlight-result-meta {
    display: flex;
    gap: 10px;
    margin-top: 3px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-family: var(--font-mono, monospace);
}

.spotlight-level-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary-light);
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.spotlight-tier-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    flex-shrink: 0;
}

/* Library items - subtle purple accent */
.spotlight-library-item {
    border-left: 2px solid rgba(168, 85, 247, 0.3);
    padding-left: 10px;
}

.spotlight-import-hint {
    font-size: 10px;
    color: rgba(168, 85, 247, 0.7);
    font-style: italic;
}

/* Action items */
.spotlight-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spotlight-action-icon {
    font-size: 15px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.spotlight-action-shortcut {
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   SPOTLIGHT QUICK ACTIONS GRID (Start Screen)
   ============================================ */

.spotlight-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px 8px 8px;
}

.spotlight-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
}

.spotlight-action-tile:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
    border-color: rgba(var(--color-primary-rgb), 0.2);
    transform: translateY(-1px);
}

.spotlight-action-tile:active {
    transform: translateY(0) scale(0.97);
}

.spotlight-tile-icon {
    font-size: 20px;
}

.spotlight-tile-label {
    font-size: 9px;
    font-weight: 500;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   SPOTLIGHT RECENT SEARCHES
   ============================================ */

.spotlight-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin: 1px 0;
}

.spotlight-recent-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.spotlight-recent-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.spotlight-recent-icon {
    font-size: 12px;
    opacity: 0.4;
}

.spotlight-recent-query {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-recent-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.spotlight-recent-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
}

.spotlight-recent-remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    opacity: 0;
}

.spotlight-recent-item:hover .spotlight-recent-remove {
    opacity: 1;
}

.spotlight-recent-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: rgba(239, 68, 68, 0.9);
}

.spotlight-clear-history {
    margin-left: auto;
    font-size: 9px;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spotlight-clear-history:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.7);
}
/* Footer */
.topbar-search-footer {
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-search-hint {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.25);
    display: flex;
    gap: 4px;
    align-items: center;
}

.topbar-search-hint kbd {
    padding: 1px 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    font-size: 9px;
    font-family: var(--font-mono, monospace);
    color: rgba(255, 255, 255, 0.3);
}

.topbar-search-advanced {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(var(--color-primary-rgb), 0.7);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.topbar-search-advanced:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
    border-color: rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-primary-light);
}

/* Empty State */
.topbar-search-empty {
    padding: 32px 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.topbar-search-empty svg {
    opacity: 0.2;
    margin-bottom: 8px;
}

/* Loading State */
.topbar-search-loading {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.topbar-search-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(var(--color-primary-rgb), 0.5);
    border-radius: 50%;
    animation: topbar-spinner-rotate 0.8s linear infinite;
}

@keyframes topbar-spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Highlight matched text */
.topbar-search-highlight {
    background: rgba(var(--color-primary-rgb), 0.25);
    color: #fff;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================================
   SEARCH LOADING INDICATOR (generic)
   ============================================ */

.search-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 8px;
    background: rgba(15, 20, 30, 0.6);
    border-radius: var(--radius-md);
    margin: 8px 0;
}

.search-loading-indicator span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.search-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(100, 140, 200, 0.2);
    border-top-color: rgba(100, 140, 200, 0.8);
    border-radius: 50%;
    animation: search-spinner-rotate 0.8s linear infinite;
}

@keyframes search-spinner-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1200px) {
    .topbar-search-trigger-label {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar-search-dropdown {
        width: calc(100vw - 24px) !important;
        left: 12px !important;
        max-height: 65vh;
    }

    .spotlight-actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .topbar-search-trigger-kbd {
        display: none;
    }

    .topbar-search-panel-input {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .spotlight-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Sidebar toggle-all button styles moved to sidebar-unified.css */

