/* ============================================
   SIMPLESEARCH - ULTRA COMPACT
   ============================================ */

/* ---------- Suchformular ---------- */
.search-wrapper {
    margin-bottom: 20px;
}

.search-input {
    width: calc(100% - 110px);
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

.search-submit {
    padding: 8px 16px;
    font-size: 13px;
    margin-left: 6px;
}

/* ---------- Ergebnisse Überschrift ---------- */
.search-results h2 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    padding-bottom: 3px;
    border-bottom: 1px solid #eee;
}

/* ---------- Ergebnis Container ---------- */
.search-row {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.search-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.search-row hr {
    display: none !important;
}

/* ---------- KEINE BILDER ---------- */
.search-image {
    display: none !important;
}

/* ---------- Titel ---------- */
.search-title h3 {
    margin: 0 0 3px 0 !important;
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 600;
    color: #333;
}

.search-title a {
    color: #0066cc;
    text-decoration: none;
}

.search-title a:hover {
    text-decoration: underline;
}

/* ---------- META-ZEILE (Collection + Date) ---------- */
.search-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px !important;
    flex-wrap: wrap;
}

/* Collection Badge */
.search-collection {
    font-size: 0.65rem !important;
    color: #495057;
    padding: 1px 6px !important;
    background: #f8f9fa;
    border-radius: 2px;
    border: 1px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    order: 1; /* Collection zuerst */
}

/* Collection colors */
.search-collection[data-collection="sudelbuch"] {
    background: #f3e5f5;
    border-color: #ce93d8;
    color: #7b1fa2;
}

.search-collection[data-collection="randnotizen"] {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

.search-collection[data-collection="wegwinkl"] {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

/* Date */
.search-date {
    font-size: 0.75rem !important;
    color: #666;
    font-weight: 500;
    order: 2; /* Datum nach Collection */
}

/* ---------- SNIPPET (sehr kurz) ---------- */
.search-snippet {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4;
    color: #555;
    font-size: 0.85rem;
    max-height: 2.8em; /* ~2 Zeilen */
    overflow: hidden;
    position: relative;
}

/* Verlauf für lange Snippets */
.search-snippet:after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30%;
    height: 1.4em;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1) 70%);
}

/* Hervorhebung */
.search-snippet strong {
    background-color: #fff9c4;
    padding: 1px 2px;
    border-radius: 1px;
    font-weight: 600;
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
    .search-row {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .search-title h3 {
        font-size: 0.95rem;
    }
    
    .search-meta {
        gap: 6px;
    }
    
    .search-collection {
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
    }
    
    .search-date {
        font-size: 0.7rem !important;
    }
    
    .search-snippet {
        font-size: 0.8rem;
        max-height: 2.4em;
    }
}

/* ---------- DARK MODE ---------- */
@media (prefers-color-scheme: dark) {
    .search-snippet:after {
        background: linear-gradient(to right, rgba(26,26,26,0), rgba(26,26,26,1) 70%);
    }
    
    .search-collection {
        background: #333;
        border-color: #555;
        color: #ccc;
    }
    
    .search-collection[data-collection="sudelbuch"] {
        background: #553c9a;
        border-color: #9f7aea;
        color: #e9d8fd;
    }
}