/**
 * CSS-Styles für intelligente Suchfunktion
 * 
 * Features:
 * - Highlighting-Styles für Suchstrings
 * - Animationen für bessere UX
 * - Responsive Design
 * 
 * Version: 1.0
 * Erstellt: 25.07.2025
 */

/* ========================================
   SUCH-HIGHLIGHTING STYLES (für Tabellen)
   ======================================== */

.keyword-highlight {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease-in-out;
    animation: highlightFadeIn 0.3s ease-out;
}

.keyword-highlight:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Farben für verschiedene Keywords (zyklisch) */
.keyword-highlight-1 { background-color: #007bff; } /* Blau */
.keyword-highlight-2 { background-color: #28a745; } /* Grün */
.keyword-highlight-3 { background-color: #fd7e14; } /* Orange */
.keyword-highlight-4 { background-color: #6f42c1; } /* Lila */
.keyword-highlight-5 { background-color: #dc3545; } /* Rot */
.keyword-highlight-6 { background-color: #ffc107; } /* Gelb */

/* Alternative Klasse für JavaScript-basiertes Highlighting */
.search-highlight {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    animation: highlightFadeIn 0.3s ease-out;
}

.search-highlight:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================
   ANIMATIONEN
   ======================================== */

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

@keyframes highlightPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   SUCHFELD-ENHANCEMENTS
   ======================================== */

.search-input-enhanced {
    position: relative;
    transition: all 0.3s ease-in-out;
}

.search-input-enhanced:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.search-input-enhanced input[name="search"] {
    transition: all 0.3s ease-in-out;
}

.search-input-enhanced input[name="search"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========================================
   SUCHSTATUS-INDIKATOR
   ======================================== */

.search-status {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease-in-out;
}

.search-status.active {
    opacity: 1;
    transform: scale(1);
}

.search-status.count {
    background: #ffc107;
    color: #212529;
}

/* ========================================
   SUCHBEGRIFF-TAGS
   ======================================== */

.search-term-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.search-term-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ced4da;
    transition: all 0.2s ease-in-out;
}

.search-term-tag:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.search-term-tag .remove-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.search-term-tag .remove-btn:hover {
    background: #dc3545;
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .search-term-tags {
        flex-direction: column;
        gap: 6px;
    }
    
    .search-term-tag {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-highlight {
        padding: 1px 3px;
        font-size: 0.9em;
    }
}

@media (max-width: 576px) {
    .search-highlight {
        padding: 1px 2px;
        font-size: 0.85em;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .search-highlight {
        color: #fff;
        box-shadow: 0 1px 3px rgba(255, 255, 255, 0.2);
    }
    
    .search-term-tags {
        background: #343a40;
        border-color: #495057;
    }
    
    .search-term-tag {
        background: #495057;
        color: #e9ecef;
        border-color: #6c757d;
    }
    
    .search-term-tag:hover {
        background: #6c757d;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.search-highlight:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.search-highlight[aria-label] {
    cursor: help;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .search-highlight {
        background: #f0f0f0 !important;
        color: #000 !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .search-term-tags,
    .search-status {
        display: none !important;
    }
}











