/* --- TULEX SEARCH HAUPT-CONTAINER --- */
.control-panel {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* --- FILTER OBEN: BOX & CHIPS --- */
.filter-tools-container {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.full-term-box {
    font-size: 20px; 
    font-weight: bold;
    color: #333;
    background: #eef5f9;
    border: 2px solid #b8d4e4;
    padding: 24px 45px;
    border-radius: 4px;
    text-align: center;
    width: 50% !important;
    min-width: 300px !important; 
    box-sizing: border-box;
}

.split-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sort-chip {
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    user-select: none;
    display: inline-block;
    text-align: center;
}
.sort-chip:hover { background: #f0f0f0; border-color: #999; }
.sort-chip.active-sort { background: #0073aa; color: white; border-color: #0073aa; box-shadow: 0 2px 4px rgba(0,115,170,0.3); }

/* --- FILTER STACK & REIHEN --- */
.filter-stack-wrapper {
    display: flex;
    flex-direction: column; 
    gap: 15px;
    width: 100%;
}

.filter-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.filter-segment {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.filter-divider {
    width: 1px;
    height: 35px;
    background: #eee;
}

.filter-group-title {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
}

.checkbox-group {
    display: flex;
    gap: 10px;
    font-size: 13px;
}

/* --- NIZZA KLASSEN GRID --- */
.filter-row-bottom {
    width: 100%;
    display: block;
}

/* Container für das Grid */
#class-list {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
}

/* Die einzelnen Klassen-Chips (rechteckig) */
.class-chip {
    display: block; /* für Grid */
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 2px; /* Fast ganz eckig, aber weich */
    padding: 5px 2px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    text-align: center;
}
.class-chip:hover { background: #e2e6ea; }
.class-chip.active { background: #0073aa; color: white; border-color: #0073aa; }

/* --- TABELLE & LAYOUT --- */
.tlx-table-wrapper { width:100%; overflow-x:auto; }
#tm-widget table { width: 100%; border-collapse: collapse; margin:0; }
#tm-widget th { text-align: left; padding: 10px; background: #f1f1f1; border-bottom: 2px solid #ddd; font-size:13px; }
#tm-widget td { padding: 10px; border-bottom: 1px solid #eee; vertical-align:top; font-size:13px; }
#tm-widget tr:hover { background-color: #f9f9f9; cursor:pointer; }
.inactive-row { opacity: 0.6; background: #fafafa; }
.office-flag { margin-right: 5px; vertical-align: middle; }

/* --- DETAIL ANSICHT (SPLIT SCREEN) --- */
.content-split {
    display: grid;
    grid-template-columns: 1fr 450px; /* Rechts fix */
    gap: 0;
    border: 1px solid #ddd;
    background: #fff;
    min-height: 600px;
}
.list-column { padding:0; border-right:1px solid #eee; }

.details-column {
    display: none; /* Initial hidden */
    flex-direction: column;
    background: white;
    padding: 20px;
    overflow-y: auto;
    position: relative;
    max-height: 800px;
}

@media (max-width: 1000px) {
    .content-split { grid-template-columns: 1fr; }
    .details-column { border-left: none; border-top: 1px solid #ddd; max-height:none; }
}

.close-details-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px; cursor: pointer; color: #999;
    z-index: 10;
}

/* Detail Header */
.detail-header {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.detail-logo {
    max-width: 120px;
    max-height: 100px;
    margin-right: 20px;
    border: 1px solid #eee;
    padding: 5px;
    background: white;
}
.header-content { flex: 1; }
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}
.status-active { background-color: #28a745; }
.status-inactive { background-color: #6c757d; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
    margin-bottom: 20px;
    font-size: 13px;
    background: #fafafa;
    padding: 15px;
    border-radius: 4px;
}
.detail-item { display: flex; flex-direction: column; }
.detail-item label {
    font-size: 10px; color: #888;
    text-transform: uppercase; margin-bottom: 3px; font-weight: 600;
}
.detail-item span { font-weight: 500; color: #333; word-break: break-word; }

.section-title {
    font-size: 14px; font-weight: bold; color: #555;
    text-transform: uppercase; border-bottom: 2px solid #eee;
    padding-bottom: 5px; margin-bottom: 10px; margin-top: 20px;
}
.gs-list {
    font-size: 13px; line-height: 1.5;
    max-height: 200px; overflow-y: auto;
    background: #fff; padding: 10px; border: 1px solid #eee;
}
.gs-class { font-weight: bold; color: #0073aa; margin-right: 5px; }

/* Buttons & Stats */
.search-btn {
    background: #0073aa; color: white; border: none; padding: 8px 15px; cursor: pointer;
}
.search-btn:hover { background: #005177; }
.search-btn.loading .spinner {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
    border-radius: 50%; animation: spin 1s linear infinite; margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Statistik Container: Jetzt 4 Spalten statt 5 */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Änderung: 4 Spalten */
    gap: 15px; /* Das sorgt automatisch für den Abstand zwischen den Boxen */
    margin-bottom: 20px;
}
.stat-box {
    background: #f8f9fa; padding: 10px 15px; border-radius: 4px;
    border: 1px solid #ddd; text-align: center; flex: 1;
}
.stat-value { display: block; font-size: 20px; font-weight: bold; color: #333; }
.stat-label { font-size: 11px; text-transform: uppercase; color: #777; }
.risk-vhigh { color: #dc3545; }
.risk-high { color: #fd7e14; }

/* ============================================================
   TLX STATS BOXEN STYLES (Interactive)
   ============================================================ */

/* === GRUND-STYLE FÜR ALLE BOXEN === */
.stat-box {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent; 
    opacity: 0.9;
    background-color: #f8f9fa; /* Hellgrau Standard */
}

/* === HOVER-EFFEKT (Maus drüber für Standard-Boxen) === */
.stat-box:hover {
    background-color: #e2e6ea !important; /* Deutlich dunkleres Grau */
    transform: translateY(-2px); /* Hüpft leicht nach oben */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 1;
}

/* === AKTIV-ZUSTÄNDE (Angehakt) === */

/* 1. MARKIERT -> BLAU */
#box-sel.active-filter {
    background-color: #cfe2ff !important;  /* Helles Blau */
    border-color: #0d6efd !important;      /* Kräftiges Blau */
    color: #084298 !important;             /* Dunkelblauer Text */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}
#box-sel.active-filter:hover {
    background-color: #b6d4fe !important; 
}

/* 2. SEHR HOCH -> ROT */
#box-vhigh.active-filter {
    background-color: #f8d7da !important;  /* Helles Rot */
    border-color: #dc3545 !important;      /* Signalrot */
    color: #842029 !important;             /* Dunkelroter Text */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}
#box-vhigh.active-filter:hover {
    background-color: #f1aeb5 !important; 
}

/* 3. HOCH -> ORANGE */
#box-high.active-filter {
    background-color: #fff3cd !important;  /* Helles Gelb/Orange */
    border-color: #ffc107 !important;      /* Warn-Gelb */
    color: #664d03 !important;             /* Dunkles Gelb */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}
#box-high.active-filter:hover {
    background-color: #ffe69c !important; 
}

/* ============================================================
   RESET BUTTON (Unter der letzten Box)
   ============================================================ */

#box-reset {
    /* POSITIONIERUNG: 4. Spalte in der neuen Zeile */
    grid-column: 4;          
    
    /* OPTIK: Identisch zu den anderen Boxen */
    width: 100% !important;
    height: auto !important;
    padding: 15px !important; /* Gleiches Padding wie .stat-box */
    border-radius: 8px !important; /* Gleiche Ecken wie .stat-box */
    background-color: #fff !important;
    border: 1px solid #ddd !important;

    /* INHALT: Untereinander (Standard) */
    display: flex !important;
    flex-direction: column !important; 
    align-items: center;
    justify-content: center;
    gap: 0; 
}

/* Das Icon wieder groß machen (wie bei den anderen) */
#box-reset .stat-value {
    font-size: 24px !important; 
    margin-bottom: 5px !important;
    color: #666;
    line-height: 1.2;
}

/* Label normalisieren */
#box-reset .stat-label {
    font-size: 11px !important;
    text-transform: uppercase;
    color: #777;
    margin-top: 0 !important;
    font-weight: normal !important;
}

/* Hover-Effekt: Rot und leichtes Anheben */
#box-reset:hover {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
#box-reset:hover .stat-value,
#box-reset:hover .stat-label {
    color: #dc3545 !important;
}
/* ============================================================
   NEUES 2-SPALTEN LAYOUT (Marke Links / Filter Rechts)
   ============================================================ */

/* Der Haupt-Container wird zum Gitter */
.control-panel {
    display: grid !important;
    grid-template-columns: 350px 1fr !important; /* Links fest, Rechts flexibel */
    gap: 40px !important; /* Fester Abstand dazwischen */
    align-items: start;
}

/* Linke Spalte (Marke, Tipps, Info) */
.filter-tools-container {
    border-bottom: none !important; /* Die Trennlinie entfernen wir hier */
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    width: 100% !important;
}

/* Die Marken-Box füllt jetzt exakt die linke Spalte aus */
.full-term-box {
    width: 100% !important; 
    min-width: 0 !important; 
}

/* Die Info-Box (Mouseover) füllt auch die linke Spalte */
#class-hover-info {
    width: 100% !important;
    min-width: 0 !important;
}

/* Rechte Spalte (Filter & Klassen) */
.filter-stack-wrapper {
    width: 100% !important;
    padding-top: 0 !important;
}

/* Mobile Ansicht: Untereinander */
@media (max-width: 1100px) {
    .control-panel {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}