/* static/css/style.css */

/* ==========================================================================
   1. Globale Variablen & Grund-Setup
   ========================================================================== */
:root {
    /* DARK MODE (Standard) - MIT NEUEN, VERBESSERTEN FARBEN */
    --bg-color: #0a0a0a;
    --panel-bg: #161618;
    --text-color: #e8e8e8;
    --header-color: #ffc93c;
    --label-color: #00bfff;
    --positive-color: #00ff7f;
    --negative-color: #ff4757;
    --panel-border: #2c2c2e;
    --font-family: 'Consolas', 'Menlo', 'Courier New', monospace;
    --glow-color: rgba(0, 191, 255, 0.45);
}

/* LIGHT MODE - FINAL, PRÄZISE KORRIGIERTE VERSION */
html.light-mode {
    --bg-color: #ffffff;               /* BEIBEHALTEN: Weißer Seitenhintergrund */
    --panel-bg: #f1f3f5;               /* BEIBEHALTEN: Verbessertes hellgraues Panel */
    --text-color: #212529;             /* BEIBEHALTEN: Dunkler Text für Kontrast */

    /* --- HIER SIND DIE WIEDERHERGESTELLTEN ORIGINALFARBEN --- */
    --header-color: #d9534f;           /* WIEDERHERGESTELLT: Originales Rot für Header und Akzente */
    --label-color: #0275d8;            /* WIEDERHERGESTELLT: Originales Blau für Labels */
    --positive-color: #5cb85c;         /* WIEDERHERGESTELLT: Originales Grün */
    --negative-color: #d9534f;         /* WIEDERHERGESTELLT: Originales Rot für negative Werte */

    /* --- HIER SIND DIE BEIBEHALTENEN VERBESSERUNGEN --- */
    --panel-border: #dee2e6;           /* BEIBEHALTEN: Verbesserte, klare Border-Farbe */
    --glow-color: rgba(2, 117, 216, 0.4); /* WIEDERHERGESTELLT: Passend zum originalen Blau */
}

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

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

@keyframes blink {
    50% { opacity: 0; }
}


body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 1rem;
    font-size: 14px;
    box-sizing: border-box;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* ==========================================================================
   2. Haupt-Layout-Container
   ========================================================================== */
.terminal-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 2rem);
    gap: 1rem;
}

header {
    flex-shrink: 0;
    border-bottom: 2px solid var(--header-color);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.5s ease-in-out;
}
main, footer {
    animation: fadeIn 0.5s ease-in-out 0.2s;
    animation-fill-mode: backwards;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.theme-btn {
    background: none;
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    line-height: 1;
    transition: all 0.2s ease-in-out;
}
.theme-btn:hover {
    border-color: var(--header-color);
    color: var(--header-color);
}


main {
    flex-grow: 1;
    display: grid;
    gap: 1rem;
    min-height: 0;
}

footer {
    flex-shrink: 0;
    min-height: 220px;
}


/* ==========================================================================
   3. Panel-Styling (Allgemein)
   ========================================================================== */
.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

html.light-mode .panel {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.07);
}

.panel:hover {
    border-color: var(--label-color);
    box-shadow: 0 0 8px -2px var(--glow-color);
}

.panel-header {
    background-color: var(--panel-border);
    color: var(--header-color);
    padding: 0.4rem 0.6rem;
    font-weight: bold;
    flex-shrink: 0;
    transition: background-color 0.3s, color 0.3s;
    min-height: 1.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

html.light-mode .panel-header {
    background-color: #f8f9fa;
}


.panel-content {
    padding: 0.8rem;
    overflow-y: auto;
    flex-grow: 1;
}

.yearly-panel .panel-content {
    overflow-y: visible;
}

/* ==========================================================================
   4. Spezifische Layouts für die Seiten
   ========================================================================== */
.main-grid {
    grid-template-columns: 400px 280px minmax(0, 1fr) !important;
    max-width: 100% !important;
    width: 100% !important;
}



.main-grid > .panel .panel-content {
    overflow-y: visible;
}

.screener-main-grid {
    grid-template-columns: 300px 1fr;
}

@media (min-width: 1200px) {
    .screener-main-grid {
        grid-template-columns: 350px 1fr;
    }
}

@media (min-width: 1400px) {
    .screener-main-grid {
        grid-template-columns: 400px 1fr;
    }
}

/* ==========================================================================
   5. Komponenten-Styling (Formulare, Tabellen etc.)
   ========================================================================== */
.controls-panel label { display: block; margin-bottom: 0.2rem; color: var(--label-color); }
.controls-panel .panel-content { gap: 0.8rem; display: flex; flex-direction: column; overflow-y: visible; }
select, input, textarea, .control-button {
    background-color: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--panel-border);
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.2rem;
    font-family: var(--font-family);
    border-radius: 3px;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s, color 0.3s;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--header-color);
    box-shadow: 0 0 5px -1px var(--glow-color);
}

html.light-mode select, html.light-mode input, html.light-mode textarea {
    background-color: #fff;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
    background: var(--panel-border);
    height: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px;
    background-color: var(--label-color);
    height: 20px;
    width: 10px;
    border-radius: 2px;
    transition: background-color 0.3s;
}
input[type="range"]:hover::-webkit-slider-thumb {
    background-color: var(--header-color);
}


textarea { resize: vertical; }
.date-inputs, .input-row { display: flex; gap: 1rem; }
.input-row > div { flex: 1; }

.control-button {
    cursor: pointer;
    text-align: center;
    font-weight: bold;
}
.control-button:hover {
    color: var(--label-color);
    border-color: var(--label-color);
}
.control-button:active {
    transform: translateY(1px);
}

#start-scan-button {
    background-color: var(--label-color);
    color: #fff;
    border-color: var(--label-color);
}
#start-scan-button:hover {
    color: #fff;
    opacity: 0.9;
    transform: translateY(-2px);
}


.control-button:disabled {
    background-color: var(--panel-border);
    color: var(--label-color);
    cursor: not-allowed;
    border-color: var(--panel-border);
    opacity: 0.7;
    transform: translateY(0);
}

#universal-search-container { position: relative; }
#universal-search-results {
    position: absolute;
    background-color: var(--panel-bg);
    border: 1px solid var(--header-color);
    width: 100%;
    box-sizing: border-box;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}
.search-result-item { padding: 0.5rem; cursor: pointer; border-bottom: 1px solid var(--panel-border); }
.search-result-item:hover { background-color: var(--bg-color); color: var(--header-color); }
.search-result-item small { color: #999; margin-left: 0.5rem; }
html.light-mode .search-result-item small {
    color: #6c757d;
}

pre {
    font-family: var(--font-family);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

pre#stats-output {
    min-height: 240px; /* Verhindert das Kollabieren des Layouts und das "Springen" des Winrate-Charts */
}


.table-container {
    padding: 0;
    overflow: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
th, td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
    word-wrap: break-word;
}
th {
    color: var(--label-color);
    position: sticky;
    top: 0;
    background-color: var(--panel-bg);
}
table tbody tr {
    opacity: 0;
    transform: translateY(10px);
    animation: slideUpFadeIn 0.4s ease-out forwards;
}

table tbody tr:hover {
    background-color: var(--panel-border);
    color: var(--header-color);
}

/* NEU: Verbesserte Farben mit Leuchteffekt */
td.positive, span.positive {
    color: var(--positive-color);
    text-shadow: 0 0 7px rgba(0, 255, 127, 0.4);
}
td.negative, span.negative {
    color: var(--negative-color);
    text-shadow: 0 0 7px rgba(255, 71, 87, 0.4);
}

/* Leuchteffekt im Light-Mode deaktivieren, da er dort nicht gut aussieht */
html.light-mode td.positive,
html.light-mode span.positive,
html.light-mode td.negative,
html.light-mode span.negative {
    text-shadow: none;
}


th[data-col-key] { cursor: pointer; }

.chart-panel .panel-content { padding: 0.5rem; position: relative; }
#chart-header { cursor: crosshair; }

.chart-actions {
    display: flex;
    gap: 0.5rem;
}
.chart-action-btn {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--label-color);
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease-in-out;
}
.chart-action-btn:hover {
    border-color: var(--header-color);
    color: var(--header-color);
}
.chart-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Spezieller Stil für einen "aktiven" Button, einschließlich des Zoom-Buttons */
.chart-action-btn.active,
.control-button.active {
    background: var(--label-color);
    border-color: var(--label-color);
    font-weight: bold;
    color: #FFFFFF; /* Weißer Text für guten Kontrast */
}

/* Spezifische Textfarbe für den Dark Mode, um den Kontrast zu verbessern */
html.dark-mode .chart-action-btn.active,
html.dark-mode .control-button.active {
    color: var(--panel-bg);
}

/* Hover-State für aktive Buttons beibehalten */
.control-button.active:hover,
.chart-action-btn.active:hover {
    background: var(--label-color);
    border-color: var(--label-color);
    color: #FFFFFF;
    transform: none;
}

html.dark-mode .control-button.active:hover,
html.dark-mode .chart-action-btn.active:hover {
    color: var(--panel-bg);
}

.nav-link { color: var(--label-color); text-decoration: none; transition: color 0.2s; }
.nav-link:hover { color: var(--header-color); text-decoration: underline; }

.nav-action-button {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--label-color);
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--label-color);
    border-radius: 3px;
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
    text-align: center;
    font-size: 13px;
}

.nav-action-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
    background-color: var(--header-color);
    border-color: var(--header-color);
}

/* === Button-Styling für den Ladezustand === */
#start-scan-button {
    position: relative;
    overflow: hidden;
}

#start-scan-button .progress-container {
    display: none; /* Standardmäßig unsichtbar */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 1;
}

#start-scan-button .progress-fill {
    height: 100%;
    width: 0; /* Beginnt bei 0 Breite */
    background-color: var(--label-color); /* GEÄNDERT: Exakte Farbe des Buttons */
    transition: width 0.3s linear; /* Fließende Animation für die Breite */
}

/* Wenn der Button die "loading"-Klasse hat */
#start-scan-button.loading {
    background-color: var(--panel-border); /* Hintergrundfarbe während des Ladens */
    border-color: var(--panel-border);
}

#start-scan-button.loading .progress-container {
    display: block; /* Macht den Container sichtbar */
}
#start-scan-button.loading .button-text {
    color: transparent; /* Versteckt den ursprünglichen Text */
}

/* Entfernt die alte Text-Prozentanzeige */
#start-scan-button.loading::after {
    content: none;
}
/* === ENDE DER ÄNDERUNGEN === */


.loader { text-align: center; color: var(--label-color); margin-top: 0.5rem; }
.blinking-cursor {
    animation: blink 1s step-end infinite;
    font-weight: bold;
    color: var(--header-color);
}

.error { color: var(--negative-color); margin-top: 0.5rem; font-weight: bold; }
.controls-panel .separator { border: none; border-top: 1px solid var(--panel-border); margin: 1rem 0; }
.info-message { font-style: italic; color: var(--label-color); padding: 0.5rem; background-color: rgba(128,128,128,0.1); text-align: center; border: 1px dashed var(--panel-border); }

#screener-asset-search-container { position: relative; }
#screener-asset-search-results { position: absolute; background-color: var(--panel-bg); border: 1px solid var(--header-color); width: 100%; box-sizing: border-box; max-height: 200px; overflow-y: auto; z-index: 1000; top: 100%; left: 0; }
.search-results-overlay { position: absolute; background-color: var(--panel-bg); border: 1px solid var(--header-color); width: 100%; box-sizing: border-box; max-height: 300px; overflow-y: auto; z-index: 1000; }

.modal-content {
    background-color: var(--panel-bg);
    border: 1px solid var(--header-color);
    width: 400px;
    max-width: 90%;
    display: flex;
    flex-direction: column;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem; background-color: var(--panel-border); color: var(--header-color); }
html.light-mode .modal-header { background-color: #f8f9fa; }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { font-size: 24px; cursor: pointer; color: var(--text-color); }
.modal-close:hover { color: var(--header-color); }
.modal-body { padding: 1rem; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.modal-quick-select { display: flex; gap: 0.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--panel-border); }
.quick-select-btn { flex-grow: 1; background-color: var(--bg-color); color: var(--label-color); border: 1px solid var(--panel-border); padding: 0.4rem; font-size: 12px; cursor: pointer; }
.quick-select-btn:hover { background-color: var(--panel-bg); border-color: var(--label-color); }
#years-checkbox-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.8rem; }
.year-checkbox-label { display: flex; align-items: center; cursor: pointer; font-size: 13px; }
.year-checkbox-label input { margin-right: 0.5rem; }
.modal-footer { padding: 0.8rem; text-align: right; border-top: 1px solid var(--panel-border); }
.modal-footer button { background-color: var(--header-color); color: #fff; border: none; padding: 0.6rem 1rem; font-weight: bold; cursor: pointer; }
.modal-footer button:hover { opacity: 0.9; }

.delete-asset-action {
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

.delete-asset-action {
    color: var(--header-color);
}

.delete-asset-action:hover {
    color: var(--negative-color);
}

html.light-mode .delete-asset-action {
    color: var(--text-color);
}

html.light-mode .delete-asset-action:hover {
    color: var(--negative-color);
}

/* === NEUE CSS REGELN FÜR ZOOM FUNKTION === */

/* Stil für den aktiven Zoom-Button */
.chart-action-btn.active {
    background: var(--label-color);
    color: var(--panel-bg);
    border-color: var(--label-color);
    font-weight: bold;
}

/* Ändert den Text des Zoom-Buttons für besseres Feedback */
#toggle-zoom-button {
    min-width: 80px; /* Stellt sicher, dass die Breite stabil bleibt */
    text-align: center;
}

/* Ändert den Cursor über dem Chart-Header, um den Drag-Modus zu verdeutlichen */
#chart-header {
    cursor: crosshair;
}

/* Ändert den Cursor über dem eigentlichen Chart-Canvas */
#seasonal-chart {
    cursor: crosshair; /* Standard-Cursor */
}

/* === FIX FÜR MODAL SCROLL-VERHALTEN (Korbverwaltung) === */
#modal-added-assets-table th {
    position: static;
}

/* In style.css am Ende hinzufügen */

.search-result-item strong {
    color: var(--header-color); /* Hebt den Text in der Akzentfarbe hervor */
    font-weight: bold;
    background-color: rgba(255, 201, 60, 0.1); /* Optional: leichter Hintergrund */
}

html.light-mode .search-result-item strong {
    color: var(--header-color);
    background-color: rgba(217, 83, 79, 0.1);
}

/* ==========================================================================
   6. Custom Select Dropdown Styling (FINALE, STABILE VERSION)
   ========================================================================== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    font-family: var(--font-family);
}

.custom-select {
    position: relative;
}

/* Der klickbare Haupt-Button */
.custom-select-trigger {
    background-color: var(--panel-bg); /* WIEDERHERGESTELLT: Sicherer Standardhintergrund (dunkelgrau) */
    color: var(--text-color);
    border: 1px solid var(--panel-border);
    padding: 0.6rem 1rem;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 3px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.25s ease-in-out;
    user-select: none;
}

/* Hover-Effekt: Färbt den Button in der Akzentfarbe */
.custom-select-wrapper:hover .custom-select-trigger {
    background-color: var(--header-color);
    border-color: var(--header-color);
    color: #fff;
}

/* Der kleine Pfeil im Button */
.custom-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-color);
    transition: transform 0.3s ease, border-top-color 0.25s ease-in-out;
}

/* Pfeil-Farbe im Hover anpassen */
.custom-select-wrapper:hover .custom-select-trigger .custom-arrow {
    border-top-color: #fff;
}

.custom-select.open .custom-arrow {
    transform: rotate(180deg);
}


/* Die aufklappende Liste mit den Optionen */
.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--panel-bg); /* Standard für Dark-Mode (dunkelgrau) */
    border: 1px solid var(--header-color);
    border-top: none;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: visible;
    z-index: 1001;
    display: none;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    transform: translateY(5px);
    opacity: 0;
    animation: slideUpFadeIn 0.2s ease-out forwards;
}

.custom-select.open .custom-options {
    display: block;
}

/* Eine einzelne Option in der Liste */
.custom-option {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid var(--panel-border);
    transition: background-color 0.2s, color 0.2s;
    color: var(--text-color); /* Standard für Dark-Mode (hell) */
    font-weight: 500;
}
.custom-option:last-child {
    border-bottom: none;
}
.custom-option:hover {
    background-color: var(--header-color);
    color: var(--bg-color); /* Kontrastfarbe (schwarz/weiß) */
}


/* === KORREKTUR FÜR LIGHT-MODE === */

/* Haupt-Button im Light-Mode */
html.light-mode .custom-select-trigger {
    background-color: #ffffff; /* Explizit weiß */
    color: #212529;
    border: 1px solid #dee2e6;
}

/* Dropdown-Liste im Light-Mode */
html.light-mode .custom-options {
    background-color: #ffffff; /* Weißer Hintergrund */
}

/* Optionen im Light-Mode */
html.light-mode .custom-option {
    color: #212529; /* Dunkler Text */
    border-bottom: 1px solid #e9ecef; /* Heller Rand */
}

/* ==========================================================================
   7. Winrate Donut Chart Styling (NEU & VERBESSERT)
   ========================================================================== */
#winrate-chart-container {
    flex-grow: 0;
    height: 220px;  /* Optimal für Text und Fenster-Größe */
    width: 220px;  /* Feste Breite statt max-width für perfekten Kreis */
    margin: 1rem auto 0;
    position: relative;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    /* Overflow sichtbar machen für Hover-Effekt */
    overflow: visible !important;
    padding: 20px;  /* Platz für den Hover-Effekt */
    box-sizing: content-box;  /* Padding ZUSÄTZLICH zur Größe */
}


#winrate-chart {
    max-width: 100% !important;
    max-height: 100% !important;
    position: relative !important;
}


/* Container des Stats-Panels muss Overflow erlauben */
.stats-panel .panel-content {
    overflow: visible !important;
}


#winrate-chart-container.visible {
    opacity: 1;
    visibility: visible;
}

.winrate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    font-family: var(--font-family);
    transition: color 0.3s;
    pointer-events: none; /* Stellt sicher, dass der Text Klicks nicht abfängt */
}

/* ==========================================================================
   8. NEUE REGELN FÜR HOCHWERTIGES WINRATE-CHART
   ========================================================================== */

/* === AKTUALISIERT mit neuen Farben === */
@keyframes breathing-glow {
  0% {
    /* NEUE FARBE FÜR DARK MODE */
    box-shadow: 0 0 3px rgba(106, 147, 176, 0.2), 0 0 5px rgba(106, 147, 176, 0.2);
  }
  50% {
    /* NEUE FARBE FÜR DARK MODE */
    box-shadow: 0 0 10px rgba(106, 147, 176, 0.6), 0 0 15px rgba(106, 147, 176, 0.6);
  }
  100% {
    /* NEUE FARBE FÜR DARK MODE */
     box-shadow: 0 0 3px rgba(106, 147, 176, 0.2), 0 0 5px rgba(106, 147, 176, 0.2);
  }
}

html.light-mode @keyframes breathing-glow {
  0% {
    /* NEUE FARBE FÜR LIGHT MODE */
    box-shadow: 0 0 3px rgba(106, 147, 176, 0.2), 0 0 5px rgba(106, 147, 176, 0.2);
  }
  50% {
    /* NEUE FARBE FÜR LIGHT MODE */
    box-shadow: 0 0 10px rgba(106, 147, 176, 0.5), 0 0 15px rgba(106, 147, 176, 0.5);
  }
  100% {
    /* NEUE FARBE FÜR LIGHT MODE */
    box-shadow: 0 0 3px rgba(106, 147, 176, 0.2), 0 0 5px rgba(106, 147, 176, 0.2);
  }
}

/* Diese Klasse wird per JS hinzugefügt, um den Canvas zum Leuchten zu bringen */
#winrate-chart.is-glowing {
    animation: breathing-glow 2.5s ease-in-out infinite;
    border-radius: 50%; /* Wichtig, damit der Schatten rund ist */
}

/* Verleiht dem Text in der Mitte mehr Tiefe */
.winrate-text {
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   9. Date Picker Calendar Styling (NEU)
   ========================================================================== */
.calendar-popup {
    display: none;
    position: absolute;
    width: 280px;
    background-color: var(--panel-bg);
    border: 1px solid var(--header-color);
    z-index: 1002;
    font-family: var(--font-family);
    animation: fadeIn 0.2s ease-out;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--panel-border);
}

.calendar-month-year {
    font-weight: bold;
    color: var(--header-color);
}

.calendar-nav-btn {
    background: none;
    border: 1px solid var(--panel-border);
    color: var(--label-color);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 14px;
}
.calendar-nav-btn:hover {
    border-color: var(--header-color);
    color: var(--header-color);
}

.calendar-grid-header, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
    padding: 0.5rem;
}

.calendar-grid-header > div {
    font-size: 11px;
    font-weight: bold;
    color: var(--label-color);
}

.calendar-day-cell {
    padding: 0.5rem 0;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
    border: 1px solid transparent;
}

.calendar-day-cell:hover {
    background-color: var(--panel-border);
    color: var(--text-color);
}

.calendar-day-cell.selected {
    background-color: var(--label-color);
    color: #fff;
    font-weight: bold;
}

.calendar-day-cell.today {
    border-color: var(--header-color);
}

input[readonly] {
    cursor: pointer;
    background-color: var(--bg-color);
}
html.light-mode input[readonly] {
    background-color: #e9ecef;
}

/* === FINALER MASTER-BLOCK (GRÖSSE & SICHTBARKEIT) === */

/* --- 1. Grundlegendes Layout für den Header --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--header-color);
}
.header-logo {
    flex-shrink: 0;
}
header h1 {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    padding: 0 1.5rem;
    line-height: 1.1;
}


/* --- 2. GRÖSSEN-EINSTELLUNGEN (Ihr Kontrollzentrum) --- */

/* Standard-Größen (für Dark Mode) */
header h1 {
    font-size: 1.8rem; /* <-- Größe der Überschrift im DARK MODE */
}
.header-logo img {
    height: 50px;      /* <-- Größe des Logos im DARK MODE */
    width: auto;
}

/* Abweichende Größen (NUR für White Mode) */
html.light-mode header h1 {
    font-size: 1.8rem; /* <-- Größe der Überschrift im WHITE MODE */
}
html.light-mode .header-logo img {
    height: 50px;      /* <-- Größe des Logos im WHITE MODE */
}


/* --- 3. SICHTBARKEIT DER LOGOS (Die entscheidende Korrektur) --- */
/* Diese Regeln stellen sicher, dass immer nur ein Logo sichtbar ist. */

/* Im Dark Mode (Standard): .logo-dark ist sichtbar, .logo-light ist versteckt. */
.logo-dark {
    display: block;
}
.logo-light {
    display: none;
}

/* Im White Mode: .logo-light wird sichtbar, .logo-dark wird versteckt. */
html.light-mode .logo-dark {
    display: none;
}
html.light-mode .logo-light {
    display: block;
}

/* === Ende des finalen Master-Blocks === */

/* Verhindert, dass der Logo-Link eine Unterstreichung bekommt */
.header-logo a {
    text-decoration: none;
    border: none;
    outline: none;
}

/* ==========================================================================
   10. COT Report Page Styling
   ========================================================================== */

.cot-main-grid {
    grid-template-columns: 400px 1fr; /* Linke Spalte für Auswahl, rechte für Daten */
}

/* KRITISCHE ÄNDERUNG: Panel-Content muss den vollen Raum nutzen */
.futures-selection-panel .panel-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 2.5rem); /* 100% minus Header-Höhe */
    padding: 0.8rem;
    overflow: hidden;
}

.futures-selection-panel .table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.cot-data-panel .table-container {
    /* Höhe der Tabelle an den sichtbaren Bereich anpassen und Scrollen ermöglichen */
    height: calc(100vh - 160px);
    overflow-y: auto;
}

.futures-selection-panel tbody tr {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

/* Stil für die aktive (ausgewählte) Zeile in der linken Tabelle */
.futures-selection-panel tbody tr.active {
    background-color: var(--header-color);
    color: var(--panel-bg);
    font-weight: bold;
}

.futures-selection-panel tbody tr.active:hover {
    background-color: var(--header-color);
    color: var(--panel-bg);
    opacity: 0.9;
}

#futures-search-input {
    margin-bottom: 0.8rem;
    position: sticky;
    top: 0;
    background-color: var(--panel-bg);
    z-index: 10;
    flex-shrink: 0;
}

/* ==========================================================================
   11. COT Report Page Styling (FINALE VERSION)
   ========================================================================== */

/* Allgemeine Stile für alle COT-Tabellen */
#cot-legacy-table,
#cot-tff-table,
#cot-disaggregated-table {
    margin-top: 1rem;
    border-spacing: 0;
    text-align: right;
}

#cot-legacy-table th, #cot-legacy-table td,
#cot-tff-table th, #cot-tff-table td,
#cot-disaggregated-table th, #cot-disaggregated-table td {
    padding: 0.6rem;
    white-space: nowrap;
    vertical-align: middle;
}

/* --- FINALE KORREKTUR: Umfassende Regel für alle Header-Zellen --- */
/* Diese Regel zeichnet eine vollständige orange Umrandung um JEDE Zelle im Tabellenkopf */
#cot-legacy-table thead th,
#cot-tff-table thead th,
#cot-disaggregated-table thead th {
    border: 1px solid var(--header-color);
    text-align: center;
}

/* Haupt-Titel-Spalte (z.B. "Cot Legacy", "TFF Report") */
.legacy-header-main {
    text-align: left;
    width: 15%;
}

/* Datumszeile */
.header-date {
    background-color: var(--panel-border);
    color: var(--text-color);
    text-align: left;
    font-weight: bold;
    padding-left: 1rem;
    font-size: 13px;
    /* Entfernt die obere Linie, da sie jetzt von der th-Regel kommt */
    border-top: none;
}

/* Zeilen-Titel (z.B. "Positions", "Changes") */
#cot-legacy-table tbody .row-header,
#cot-tff-table tbody .row-header,
#cot-disaggregated-table tbody .row-header {
    text-align: left;
    font-weight: bold;
    color: var(--label-color);
    border-right: 1px solid var(--panel-border);
}

/* Zentrierung für alle Datenzellen im Körper */
#cot-legacy-table tbody td,
#cot-tff-table tbody td,
#cot-disaggregated-table tbody td {
    text-align: center;
}
/* Rück-Korrektur: Zeilen-Header sollen linksbündig bleiben */
#cot-legacy-table tbody .row-header,
#cot-tff-table tbody .row-header,
#cot-disaggregated-table tbody .row-header {
    text-align: left;
}

/* Styling für Netto-Positionen in allen Tabellen */
.net-position-cell {
    text-align: center;
    border-left: 1px solid var(--panel-border);
}
.net-position-cell div:first-child {
    font-weight: bold;
    font-size: 1.1em;
}
.net-position-cell div:last-child {
    font-size: 0.9em;
}

/* Vertikale Trennlinien für den Tabellenkörper (bleiben unverändert) */
#cot-legacy-table tbody td:nth-child(4),
#cot-legacy-table tbody td:nth-child(7),
#cot-legacy-table tbody td:nth-child(9) {
    border-left: 1px solid var(--panel-border);
}

#cot-tff-table tbody td:nth-child(4),
#cot-tff-table tbody td:nth-child(6),
#cot-tff-table tbody td:nth-child(8),
#cot-tff-table tbody td:nth-child(10),
#cot-disaggregated-table tbody td:nth-child(4),
#cot-disaggregated-table tbody td:nth-child(6),
#cot-disaggregated-table tbody td:nth-child(8),
#cot-disaggregated-table tbody td:nth-child(10) {
    border-left: 1px solid var(--panel-border);
}

/* ==========================================================================
   12. FINALE KORREKTUR FÜR COT LEGACY REPORT (Zentrierung & Linien)
   ========================================================================== */

/* Stellt die grundlegende Zentrierung für alle Datenzellen sicher */
#cot-legacy-table tbody td {
    text-align: center;
    vertical-align: middle;
}

/* Stellt sicher, dass die erste Spalte (die Titel) linksbündig bleibt */
#cot-legacy-table tbody .row-header {
    text-align: left;
}

/* Fügt die vertikalen Trennlinien zwischen den Hauptgruppen hinzu */
#cot-legacy-table th:nth-child(3),
#cot-legacy-table th:nth-child(4),
#cot-legacy-table th:nth-child(5) {
    border-left: 1px solid var(--panel-border);
}

#cot-legacy-table tbody td:nth-child(4),  /* Links von "Large Speculators" */
#cot-legacy-table tbody td:nth-child(7),  /* Links von "Total" */
#cot-legacy-table tbody td:nth-child(9) {  /* Links von "Small Traders" */
    border-left: 1px solid var(--panel-border);
}

/* Korrigiert die Ausrichtung der Netto-Positionen und stellt sicher,
   dass sie sich wie die anderen Datenzellen verhalten */
.net-position-cell {
    text-align: center; /* Wichtigste Änderung: Zentrierung */
    vertical-align: middle;
    border-left: 1px solid var(--panel-border);
}

/* ==========================================================================
   13. Badge Styling (Refactored & Expanded)
   ========================================================================== */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-shadow: none;
    line-height: 1.2;
}

.legacy-badge {
    background-color: var(--positive-color); /* Green */
    color: var(--panel-bg);
}

.tff-badge {
    background-color: var(--label-color); /* Blue */
    color: var(--panel-bg);
}

.disaggregated-badge {
    background-color: var(--header-color); /* Yellow/Orange */
    color: var(--panel-bg);
}


/* Light mode adjustments */
html.light-mode .badge {
    color: #ffffff;
}

html.light-mode .tff-badge {
    color: #ffffff;
}


/* ==========================================================================
   Zusätzliche Light-Mode-Anpassungen (FINALE KORREKTUR)
   ========================================================================== */

/* Header der Haupt-Panels im Light Mode */
html.light-mode .panel-header {
    background-color: #e9ecef;
    border-bottom: 1px solid var(--panel-border);
    /* Die Zeile "color: #000;" wurde hier absichtlich entfernt, damit die korrekte rote Akzentfarbe aus den Variablen wieder greift. */
}

/* Spezielles Styling für die aktive Future-Auswahl */
html.light-mode .futures-selection-panel tbody tr.active {
    background-color: var(--header-color);
    color: #ffffff;
}
html.light-mode .futures-selection-panel tbody tr.active:hover {
    background-color: var(--header-color);
    color: #ffffff;
    opacity: 0.9;
}

/* Tabellenkopf (TH-Elemente) im Light Mode */
html.light-mode .cot-data-panel th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: bold;
    border-bottom: 2px solid var(--panel-border);
    border-left: 1px solid var(--panel-border);
}
html.light-mode .cot-data-panel th:first-child {
    border-left: none;
}

/* Datumszeile im Light Mode */
html.light-mode .header-date {
    background-color: #e9ecef;
    text-align: center;
    color: var(--text-color);
    border-top: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
}

/* Zeilen im Tabellenkörper (Zebra-Striping) */
html.light-mode .cot-data-panel tbody tr {
    background-color: var(--panel-bg);
}
html.light-mode .cot-data-panel tbody tr:nth-of-type(even) {
    background-color: #ffffff;
}
html.light-mode .cot-data-panel tbody tr:hover {
    background-color: #e0eaff;
    color: var(--text-color);
}

/* Titel der Zeilen (z.B. "Positions") */
html.light-mode .cot-data-panel .row-header {
    font-weight: bold;
    color: var(--text-color);
    border-right: 2px solid var(--panel-border);
}

/* Farben für positive/negative Werte */
html.light-mode td.positive,
html.light-mode span.positive,
html.light-mode .net-position-cell div.positive {
    color: var(--positive-color);
    font-weight: 500;
    text-shadow: none;
}
html.light-mode td.negative,
html.light-mode span.negative,
html.light-mode .net-position-cell div.negative {
    color: var(--negative-color);
    font-weight: 500;
    text-shadow: none;
}

/* ==========================================================================
   14. Interaktiver Cursor für COT Chart
   ========================================================================== */
#cot-indicator-chart.chart-interactive {
    cursor: grab;
}

#cot-indicator-chart.chart-interactive:active {
    cursor: grabbing;
}

/* ==========================================================================
   15. Masterpiece Edition - COT Chart & Table FX
   ========================================================================== */

/* Hervorhebung für die synchronisierte Tabellenzeile */
@keyframes tableRowGlow {
  from {
    background-color: rgba(255, 201, 60, 0.2);
    box-shadow: inset 0 0 10px rgba(255, 201, 60, 0.1);
  }
  to {
    background-color: transparent;
    box-shadow: none;
  }
}

.table-row-highlight {
  /* Animation: 1.5 Sekunden lang, um sanft auszublenden */
  animation: tableRowGlow 1.5s ease-out forwards;
}

html.light-mode @keyframes tableRowGlow {
   from {
    background-color: rgba(59, 130, 246, 0.2);
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
  }
  to {
    background-color: transparent;
    box-shadow: none;
  }
}

/* Interaktiver Cursor (bereits vorhanden, wird hier nur bestätigt) */
#cot-indicator-chart.chart-interactive {
    cursor: grab;
}

#cot-indicator-chart.chart-interactive:active {
    cursor: grabbing;
}

/* ==========================================================================
   14. Interaktiver Cursor & Steuerung für COT Chart (NEU)
   ========================================================================== */

/* Wendet den "grab"-Cursor an, wenn der Chart interaktiv ist */
#cot-indicator-chart.chart-interactive {
    cursor: grab;
}

/* Ändert den Cursor zu "grabbing", wenn die Maustaste gedrückt wird */
#cot-indicator-chart.chart-interactive:active {
    cursor: grabbing;
}

/* Container für die Chart-Buttons im Panel-Header */
.chart-controls {
    display: flex;
    gap: 0.5rem;
}

/* Allgemeiner Stil für Aktions-Buttons im Chart (wie der Reset-Button) */
.chart-action-btn {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--label-color);
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease-in-out;
}

.chart-action-btn:hover {
    border-color: var(--header-color);
    color: var(--header-color);
}

.chart-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spezieller Stil für einen "aktiven" Button, falls benötigt */
.chart-action-btn.active {
    background: var(--label-color);
    color: var(--panel-bg);
    border-color: var(--label-color);
    font-weight: bold;
}

html.dark-mode .chart-action-btn.active {
    color: var(--panel-bg);
}

/* NEUER Stil nur für den Legacy Report Indikator */
.legacy-badge {
    display: inline-block;
    background-color: var(--positive-color); /* Grün für Legacy */
    color: var(--panel-bg);
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-shadow: none;
}

html.light-mode .legacy-badge {
    color: #ffffff;
}

/* Fügen Sie diese Regeln am Ende von style.css hinzu */

/* Container für die Chart-Typ-Buttons */
#chart-type-controls {
    display: flex;
    gap: 0.5rem;
    /* Zentriert die Buttons vertikal und schiebt sie nach links */
    align-items: center;
    margin-right: auto;
    padding-left: 1rem;
}

/* Stil für die einzelnen Chart-Typ-Buttons */
.chart-type-btn {
    background: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--label-color);
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease-in-out;
}

.chart-type-btn:hover {
    border-color: var(--header-color);
    color: var(--header-color);
}

/* Stil für den aktiven Button */
.chart-type-btn.active {
    background: var(--label-color);
    color: var(--panel-bg);
    border-color: var(--label-color);
    font-weight: bold;
}

.chart-type-btn.active:hover {
    background: var(--label-color);
    color: var(--panel-bg);
    border-color: var(--label-color);
}

/* Fügen Sie diese Regeln am Ende von style.css hinzu */

#cot-index-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-right: auto;
    padding-left: 1rem;
}

#cot-index-trader-select {
    min-width: 200px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    text-align: left;
    padding: 2px 8px;
    -webkit-appearance: none;
    appearance: none;
}

/* ==========================================================================
   17. LAYOUT FIXES
   ========================================================================== */

/*
 * FIX: Sticky Table Headers in Aktien-Analyse
 * Erzwingt, dass die Tabellenköpfe in den "Insider Trades", "Dividenden"
 * und "Analyst Ratings" Panels beim Scrollen am oberen Rand des Panels haften bleiben.
 */
#insider-tile thead,
#dividend-tile thead,
#upgrades-downgrades-tile thead {
    position: -webkit-sticky; /* Für Safari-Kompatibilität */
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Stellt sicher, dass die Header-Zellen einen soliden Hintergrund haben,
   damit der darunter scrollende Text nicht durchscheint. */
#insider-tile thead th,
#dividend-tile thead th,
#upgrades-downgrades-tile thead th {
    /* Die Hintergrundfarbe wird vom bestehenden 'th'-Stil geerbt,
       aber wir stellen hier sicher, dass sie explizit angewendet wird. */
    position: -webkit-sticky !important; /* Für Safari-Kompatibilität */
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background-color: var(--panel-bg) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Schatten für Light Mode */
html.light-mode #insider-tile thead th,
html.light-mode #dividend-tile thead th,
html.light-mode #upgrades-downgrades-tile thead th {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}



 /* ==========================================================================
   18. Calculator Page Styling (NEU & ÜBERARBEITET)
   ========================================================================== */

@keyframes result-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gauge-fill-animation {
  from { stroke-dashoffset: 565; } /* (circumference of circle) */
  to { stroke-dashoffset: 0; }
}

.calculator-grid {
    grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
    align-items: start;
}

.calculator-panel-new {
    border: 1px solid var(--panel-border);
    background-color: var(--panel-bg);
}

.calculator-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
    align-items: start;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calculator-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.calculator-form label {
    color: var(--label-color);
    font-size: 13px;
    padding-left: 2px;
}

/* Verbesserter Berechnen-Button */
#ror-calculate-btn {
    margin-top: 1rem;
    background: linear-gradient(45deg, var(--label-color), #00aaff);
    color: #fff;
    border: none;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px -5px var(--glow-color);
    transition: all 0.3s ease;
}

#ror-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -5px var(--glow-color);
    filter: brightness(1.1);
}

#ror-calculate-btn:active {
    transform: translateY(0);
    filter: brightness(1);
}

html.light-mode #ror-calculate-btn {
    background: linear-gradient(45deg, var(--label-color), #3385d8);
    color: #fff;
}

/* Resultate-Container */
.calculator-results-display {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    position: relative;
}

.results-placeholder-visible {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--label-color);
    font-size: 1.1rem;
    /* border: 2px dashed var(--panel-border); */ /* <<< ENTFERNT */
    border-radius: 8px;
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.results-container-hidden {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, visibility 0s 0.5s;
}

.results-container-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.result-box {
    width: 100%;
    /* Die folgenden zwei Zeilen wurden absichtlich entfernt, um die Box aufzulösen */
    /* background-color: var(--bg-color); */
    /* border: 1px solid var(--panel-border); */
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}



/* Diese Regel bleibt unverändert, ist aber für den Kontext wichtig */
html.light-mode .result-box {
    background-color: transparent; /* Auch hier den Hintergrund entfernen */
}

.metric-value {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
    /* Die feste Höhe wurde entfernt, um die Darstellung zu verbessern */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px; /* Stellt eine gute Mindesthöhe sicher */
}


/* Meldungs-Styling */
#ror-message {
    margin-bottom: 1rem;
    text-align: center;
}

.info-message.error {
    color: var(--negative-color);
    border-color: var(--negative-color);
}

.info-message.warning {
    color: var(--header-color);
    border-color: var(--header-color);
}

@media (max-width: 1200px) {
    .calculator-content-grid {
        grid-template-columns: 1fr;
    }
    .calculator-results-display {
      margin-top: 2rem;
      min-height: auto;
    }
    .results-container-hidden, .results-container-visible {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .results-container-hidden, .results-container-visible {
        grid-template-columns: 1fr;
    }
}

/* Light Mode Anpassungen für das neue Design */
html.light-mode .result-box {
    background-color: #ffffff;
}
html.light-mode .metric-value.positive, html.light-mode .gauge-value.positive {
    text-shadow: none;
}
html.light-mode .metric-value.negative, html.light-mode .gauge-value.negative {
    text-shadow: none;
}

/* ==========================================================================
   18. Calculator Page Styling (FINALE VERSION)
   ========================================================================== */

/* Haupt-Grid für die Rechner-Seite (Robuste Version) */
.calculator-grid-new {
    display: grid;
    /* Definiert explizit zwei Spalten mit gleicher Breite */
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch; /* Stellt sicher, dass beide die gleiche Höhe haben */
}

/* Media Query, damit die Rechner auf kleineren Bildschirmen korrekt untereinander stehen */
@media (max-width: 1250px) {
    .calculator-grid-new {
        grid-template-columns: 1fr;
    }
}

/* Allgemeiner Stil für die Rechner-Panels */
.calculator-panel-new {
    border: 1px solid var(--panel-border);
    background-color: var(--panel-bg);
}

/* Stellt sicher, dass der Inhaltsbereich die volle Höhe des Panels einnimmt */
.calculator-panel-new .panel-content {
    height: 100%;
    box-sizing: border-box;
}

/* Grid für den Inhalt des Risk of Ruin Rechners */
.calculator-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

/* Grid für den Inhalt des Monte Carlo Rechners */
.mc-content-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 1.5rem;
    height: 100%;
    box-sizing: border-box;
}

/* Styling für die Eingabeformulare beider Rechner */
.calculator-form {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Zentriert die Eingabefelder vertikal */
    gap: 1.5rem; /* Vergrößerter Abstand */
}

.calculator-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.calculator-form label {
    color: var(--label-color);
    font-size: 13px;
    padding-left: 2px;
}

/* Container für die Ergebnisse des Risk of Ruin Rechners */
.calculator-results-display {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    position: relative;
}

/* Sichtbarkeits- und Animationsklassen für Ergebnisse */
.results-placeholder-visible {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.results-container-hidden {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, visibility 0s 0.5s;
}

.results-container-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
    align-content: center;
    height: 100%;
}

/* Boxen für die einzelnen Ergebnis-Metriken */
.result-box {
    width: 100%;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.result-box-label {
    margin-top: 0.75rem;
    font-size: 1rem;
    color: var(--label-color);
}

.metric-value {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

/* Meldungs-Styling */
#ror-message {
    margin-bottom: 1rem;
    text-align: center;
}

/* ---- Monte-Carlo-spezifische Stile ---- */

/* Bereich für die Anzeige der Monte-Carlo-Ergebnisse */
.mc-results-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    justify-content: center; /* NEU: Zentriert die Inhalte (Tabelle & Chart) vertikal */
}

#mc-initial-message {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    font-style: normal;
}

/* Ergebnistabelle im Monte-Carlo-Rechner */
.mc-results-table {
    width: 100%;
    border-collapse: collapse;
}

.mc-results-table th, .mc-results-table td {
    border: 1px solid var(--panel-border);
    padding: 0.8rem;
    text-align: right;
}

.mc-results-table th {
    background-color: var(--panel-border);
    color: var(--label-color);
    font-size: 11px;
}

.mc-results-table td:first-child {
    text-align: left;
    font-weight: bold;
    color: var(--text-color);
}

html.light-mode .mc-results-table th {
    background-color: #e9ecef;
}

/* Chart-Container im Monte-Carlo-Rechner */
.mc-chart-container {
    width: 100%;
    margin-top: 1rem;
    /* flex-grow: 1; wurde entfernt, um die Zentrierung zu ermöglichen */
    min-height: 300px;
}



/* Fügen Sie diesen Block am Ende Ihrer style.css Datei hinzu */

/* ==========================================================================
   22. Valuation Page - Gauge Redesign (Ausgefallen & Animiert)
   ========================================================================== */

@keyframes gauge-fill-anim {
    from { stroke-dashoffset: 314; } /* stroke-dasharray Wert (Umfang) */
    to { /* Endwert wird per JS gesetzt */ }
}

@keyframes marker-fade-in-anim {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes potential-glow-positive {
    0%, 100% { text-shadow: 0 0 4px rgba(0, 255, 127, 0.5), 0 0 8px rgba(0, 255, 127, 0.4); }
    50% { text-shadow: 0 0 8px rgba(0, 255, 127, 0.7), 0 0 16px rgba(0, 255, 127, 0.6); }
}

@keyframes potential-glow-negative {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 71, 87, 0.6), 0 0 8px rgba(255, 71, 87, 0.5); }
    50% { text-shadow: 0 0 8px rgba(255, 71, 87, 0.8), 0 0 16px rgba(255, 71, 87, 0.7); }
}

html.light-mode @keyframes potential-glow-positive {
  0%, 100% { text-shadow: 0 0 5px rgba(92, 184, 92, 0.5); }
  50% { text-shadow: 0 0 12px rgba(92, 184, 92, 0.7); }
}

html.light-mode @keyframes potential-glow-negative {
  0%, 100% { text-shadow: 0 0 5px rgba(217, 83, 79, 0.5); }
  50% { text-shadow: 0 0 12px rgba(217, 83, 79, 0.7); }
}

/* Der Container für das neue Gauge-Display */
.valuation-gauge-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.valuation-gauge {
    width: 100%;
    overflow: visible;
}

/* Stile für die SVG-Pfade des Gauges */
.gauge-bg, .gauge-fill {
    fill: none;
    stroke-width: 22;
    stroke-linecap: round;
    transform: rotate(180deg) translate(-200px, -200px);
}

.gauge-bg {
    stroke: var(--panel-border);
}

.gauge-fill {
    stroke-dasharray: 314; /* Umfang eines Halbkreises mit Radius 100: π * 100 */
    stroke-dashoffset: 314;
    transition: stroke 0.8s ease-out;
}

.gauge-fill.animate {
    animation: gauge-fill-anim 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Styling für die Markierungslinie (aktueller Kurs) */
.gauge-marker {
    stroke: var(--text-color);
    stroke-width: 2;
    transform-origin: 100px 100px;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    animation: marker-fade-in-anim 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

/* Styling für das Text-Label der Markierung */
.gauge-marker-label {
    fill: var(--text-color);
    font-size: 10px;
    font-family: var(--font-family);
    text-anchor: middle;
    transform-origin: 100px 100px;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    animation: marker-fade-in-anim 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

/* Styling für die Fair-Value-Anzeige in der Mitte */
.gauge-fair-value {
    position: absolute;
    bottom: -5px; /* Positioniert es unter dem Gauge */
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0;
    transition: color 0.8s ease-out;
    animation: marker-fade-in-anim 0.8s ease-out forwards;
}

.gauge-fair-value::before {
    content: 'Fair Value';
    display: block;
    font-size: 0.9rem;
    font-family: var(--font-family);
    color: var(--label-color);
    margin-bottom: 0.25rem;
    font-weight: normal;
}

/* Animation für den Potenzial-Wert */
.valuation-potential.positive {
    animation: potential-glow-positive 2.5s ease-in-out infinite;
}
.valuation-potential.negative {
    animation: potential-glow-negative 2.5s ease-in-out infinite;
}

/* Die alte Diagramm-Klasse entfernen, um Konflikte zu vermeiden */
.valuation-diagram {
    display: none;
}

/* Fügen Sie diesen Block am Ende Ihrer style.css hinzu und entfernen Sie den alten Block 22 */

/* ==========================================================================
   22. Valuation Page - Key Metrics Redesign (Klar & Sinnvoll)
   ========================================================================== */

@keyframes metric-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes arrow-pulse {
    0%   { transform: scale(1) translateY(0); opacity: 0.8; }
    50%  { transform: scale(1.1) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 0.8; }
}

.key-metrics-container {
    width: 100%;
    animation: metric-fade-in 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Hauptanzeige für das Potenzial */
.potential-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.potential-value {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.potential-label {
    color: var(--label-color);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Container für die beiden Preisboxen */
.price-details-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Styling der einzelnen Boxen (Kurs & Fair Value) */
.price-box {
    flex: 1;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    background-color: var(--bg-color);
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.price-box .price-label {
    font-size: 0.9rem;
    color: var(--label-color);
}

.price-box .price-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Glow-Effekt für die Fair-Value-Box */
.price-box.glow-positive {
    border-color: var(--positive-color);
    box-shadow: 0 0 15px -2px var(--positive-color);
}
.price-box.glow-negative {
    border-color: var(--negative-color);
    box-shadow: 0 0 15px -2px var(--negative-color);
}

/* Animierter Pfeil zwischen den Boxen */
.arrow-indicator {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    animation: arrow-pulse 2s ease-in-out infinite;
}
.arrow-indicator svg {
    width: 100%;
    height: 100%;
}
.arrow-indicator.positive svg {
    fill: var(--positive-color);
}
.arrow-indicator.negative svg {
    fill: var(--negative-color);
    transform: rotate(180deg);
}

/* ==========================================================================
   22. Valuation Page - Key Metrics Redesign (Klar & Sinnvoll)
   ========================================================================== */

@keyframes metric-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes arrow-pulse {
    0%   { transform: scale(1) translateY(0); opacity: 0.8; }
    50%  { transform: scale(1.1) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 0.8; }
}

.key-metrics-container {
    width: 100%;
    animation: metric-fade-in 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.potential-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.potential-value {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.potential-label {
    color: var(--label-color);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-details-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.price-box {
    flex: 1;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    background-color: var(--bg-color);
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.price-box .price-label {
    font-size: 0.9rem;
    color: var(--label-color);
}

.price-box .price-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
}

.price-box.glow-positive {
    border-color: var(--positive-color);
    box-shadow: 0 0 15px -2px var(--positive-color);
}
.price-box.glow-negative {
    border-color: var(--negative-color);
    box-shadow: 0 0 15px -2px var(--negative-color);
}

.arrow-indicator {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    animation: arrow-pulse 2s ease-in-out infinite;
}
.arrow-indicator svg {
    width: 100%;
    height: 100%;
}
.arrow-indicator.positive svg {
    fill: var(--positive-color);
}
.arrow-indicator.negative svg {
    fill: var(--negative-color);
    transform: rotate(180deg);
}

/* ==========================================================================
   23. Valuation Page - Model Toggles
   ========================================================================== */
.model-toggle-buttons {
    display: flex;
    background-color: var(--bg-color);
    border-radius: 5px;
    padding: 3px;
    border: 1px solid var(--panel-border);
}

.model-toggle-btn {
    padding: 4px 16px;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 3px;
    font-size: 13px;
}

.model-toggle-btn:hover:not(.active) {
    background-color: var(--panel-border);
}

.model-toggle-btn.active {
    background-color: var(--label-color);
    color: #fff;
    box-shadow: 0 0 8px -2px var(--glow-color);
}

html.dark-mode .model-toggle-btn.active {
     color: var(--bg-color);
}

/* ==========================================================================
   24. Valuation Page - Final Redesign (Status & Bar Chart)
   ========================================================================== */

/* Container für die gesamte obere Anzeige */
.key-metrics-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: metric-fade-in 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* "UNDERVALUED / OVERVALUED" Box */
.valuation-status-display {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 2.5rem;
    border: 2px solid;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.valuation-status-display.positive {
    color: var(--positive-color);
    border-color: var(--positive-color);
    background-color: rgba(0, 255, 127, 0.05);
    text-shadow: 0 0 10px rgba(0, 255, 127, 0.3);
}

.valuation-status-display.negative {
    color: var(--negative-color);
    border-color: var(--negative-color);
    background-color: rgba(255, 71, 87, 0.05);
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
}

html.light-mode .valuation-status-display {
    text-shadow: none;
}

.price-details-container {
    width: 100%;
}

/* -- Bar Chart Stile -- */
.valuation-bar-chart-container {
    width: 100%;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--panel-border);
    position: relative;
    opacity: 0;
    transform: translateY(15px);
    animation: metric-fade-in 0.7s cubic-bezier(0.25, 1, 0.5, 1) 0.2s forwards;
}

.valuation-bar-chart-container .bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.valuation-bar-chart-container .bar-label {
    flex-basis: 90px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 1rem;
    font-size: 0.9rem;
}

.valuation-bar-chart-container .bar-wrapper {
    flex-grow: 1;
    height: 28px;
    background-color: var(--panel-border);
    border-radius: 4px;
}

.valuation-bar-chart-container .bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.valuation-bar-chart-container .bar.fair-value-bar {
    /* HIER IST DIE ÄNDERUNG: von --label-color zu --header-color */
    background-color: var(--header-color);
}
.valuation-bar-chart-container .bar.price-bar {
    background-color: #8a99a9;
}

html.light-mode .valuation-bar-chart-container .bar.price-bar {
    background-color: #adb5bd;
}

.bar-value-label {
    flex-basis: 110px;
    flex-shrink: 0;
    padding-left: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.5s 0.8s;
}


/* Hover-Effekt für Valuation Bar Chart */
.valuation-bar-chart-container .bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 0.2s ease; /* Filter-Transition hinzugefügt */
}

.valuation-bar-chart-container .bar-row:hover .bar {
    filter: brightness(1.1);
}

/* Speziell für Fair Value Bar */
.valuation-bar-chart-container .bar.fair-value-bar {
    background-color: var(--header-color);
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 0.2s ease;
}

/* Speziell für Price Bar */
.valuation-bar-chart-container .bar.price-bar {
    background-color: #8a99a9;
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 0.2s ease;
}

/* Zusätzlicher Hover-Effekt für die gesamte Zeile */
.valuation-bar-chart-container .bar-row {
    transition: transform 0.2s ease;
}

.valuation-bar-chart-container .bar-row:hover {
    transform: translateX(2px);
}

/* ==========================================================================
   25. Valuation Page - Info Button & Modal (Final, Optimiert V2)
   ========================================================================== */

.header-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-btn {
    background: var(--panel-border);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-style: italic;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease-in-out;
}

.info-btn:hover {
    background-color: var(--label-color);
    color: var(--panel-bg);
    border-color: var(--label-color);
    transform: scale(1.1);
}

/* FINALE, VERBESSERTE & VEREINHEITLICHTE MODAL-STYLES */
.modal-overlay {
    /* Layout properties from the old rule */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;

    /* Visibility & Transition properties from the new rule */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s 0.25s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    /* Transition NUR für das Einblenden definieren */
    transition: opacity 0.25s ease, visibility 0s 0s;
}

html.light-mode .modal-overlay {
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    /* Startzustand: Weiter unten, leicht verkleinert und unsichtbar */
    transform: translateY(25px) scale(0.95);
    opacity: 0;
    /* Transition NUR für das Einblenden definieren */
    transition: transform 0.25s cubic-bezier(0.21, 1.02, 0.73, 1), opacity 0.25s ease;
}

.modal-overlay.visible .modal-content {
    /* Endzustand: Finale Position, volle Größe und sichtbar */
    transform: translateY(0) scale(1);
    opacity: 1;
}
/* ENDE MODAL-STYLES */


.info-modal-content {
    max-width: 600px;
}

.info-modal-content .modal-body {
    line-height: 1.7;
    font-family: var(--font-body), sans-serif;
    font-size: 15px;
    color: var(--text-color);
}

/* ==========================================================================
   26. Valuation Page - Interactive Peers (MIT TRANSFORM & BRIGHTNESS)
   ========================================================================== */

/* Stile für das Peer-Valuation Chart */
.peer-chart-title {
    text-align: center;
    color: var(--header-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.peer-chart-container {
    position: relative;
    width: 100%;
    margin-top: 1rem;
}

.peer-chart-growth-header {
    position: absolute;
    top: -25px;
    right: 0;
    width: 80px;
    text-align: center;
    color: var(--header-color);
    font-size: 11px;
    font-weight: bold;
}

.peer-chart-bar-list {
    position: relative;
    z-index: 2;
    margin-top: 25px;
}

.peer-chart-row {
    display: grid;
    grid-template-columns: 100px 1fr 80px;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideUpFadeIn 0.5s ease-out forwards;
}

.peer-chart-ticker {
    text-align: right;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    transition: transform 0.2s ease; /* NEU */
}

.peer-chart-bar-wrapper {
    background-color: transparent;
    border-radius: 4px;
    height: 28px;
    position: relative;
    transition: transform 0.2s ease; /* NEU */
}

.peer-chart-growth-label {
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    transition: transform 0.2s ease; /* NEU */
}

/* NEU: Transform-Effekt beim Hover */
.peer-chart-row:hover .peer-chart-ticker,
.peer-chart-row:hover .peer-chart-bar-wrapper,
.peer-chart-row:hover .peer-chart-growth-label {
    transform: translateX(3px);
}

/* Hover-Effekt für Peer-Balken mit Brightness */
.peer-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 0.2s ease, transform 0.2s ease; /* Transform hinzugefügt */
    background-color: #8a99a9;
}

html.light-mode .peer-bar {
    background-color: #adb5bd;
}

/* Brightness-Effekt beim Hover über die Zeile */
.peer-chart-row:hover .peer-bar {
    filter: brightness(1.1);
    transform: scaleY(1.05); /* NEU: Macht den Balken leicht größer */
}

/* Speziell für die Hauptaktie */
.peer-bar.main-ticker-bar {
    background: var(--header-color);
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 0.2s ease, transform 0.2s ease;
}

html.light-mode .peer-bar.main-ticker-bar {
    background: #c0392b;
}

/* Brightness-Effekt auch für die Hauptaktie */
.peer-chart-row:hover .peer-bar.main-ticker-bar {
    filter: brightness(1.1);
    transform: scaleY(1.05); /* NEU: Macht den Balken leicht größer */
}

/* Durchschnittslinie und Label */
.peer-chart-avg-line {
    position: absolute;
    top: 25px;
    bottom: 40px;
    border-left: 2px dashed var(--header-color);
    opacity: 0.8;
    z-index: 3;
}

.peer-chart-avg-label {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background-color: var(--header-color);
    color: var(--panel-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    white-space: pre;
    z-index: 4;
}

html.light-mode .peer-chart-avg-line {
    border-left-color: #c0392b;
}

html.light-mode .peer-chart-avg-label {
    background-color: #c0392b;
}

/* PE Label */
.peer-chart-pe-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    padding-left: 5px;
    left: 0;
    transition: left 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* X-Achse */
.peer-chart-x-axis {
    position: relative;
    height: 30px;
    border-top: 1px solid var(--panel-border);
    margin-left: 110px;
    margin-right: 80px;
    margin-top: 1rem;
}

.axis-tick, .axis-label, .axis-title {
    position: absolute;
}

.axis-tick {
    bottom: 10px;
    height: 5px;
    width: 1px;
    background-color: var(--label-color);
}

.axis-label {
    bottom: -5px;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--label-color);
}

.axis-title {
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--header-color);
    font-weight: bold;
}

/* Tooltip */
.peer-tooltip {
    position: absolute;
    background-color: var(--bg-color);
    border: 1px solid var(--header-color);
    padding: 0.8rem 1rem;
    border-radius: 5px;
    z-index: 10;
    width: auto;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    visibility: hidden;
}

.peer-tooltip.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
}

.peer-tooltip h4 {
    margin: 0 0 0.8rem 0;
    color: var(--header-color);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

.peer-tooltip p {
    margin: 0.4rem 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.peer-tooltip p strong {
    color: var(--label-color);
    margin-right: 1rem;
}

/* Interaktive Peer-Zeilen (nur Cursor, kein Hintergrund) */
.peer-chart-row:has(.peer-bar:not(.main-ticker-bar)) {
    cursor: pointer;
    border-radius: 4px;
}


/* ==========================================================================
   27. Valuation Page - Financial Health Panel (MIT DYNAMISCHER SCHRIFTGRÖSSE UND SMOOTH HOVER)
   ========================================================================== */

#financial-health-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.5rem;
    animation: fadeIn 0.6s ease-out;
    overflow: hidden !important;
}

.health-chart-wrapper {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    gap: 3rem;
    height: 340px;
    border-bottom: 2px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

.health-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    flex: 1;
}

.health-column-group {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    height: 100%;
    width: 100%;
    justify-content: center;
}

.health-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 105px;
    max-width: 140px;
    gap: 0.75rem;
    /* NEU: Smooth transition für die gesamte Spalte */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-column-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.5s 0.8s, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* NEU: Längere, smoothere Transform */
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.health-column-bar {
    width: 0;
    height: 0;
    border-radius: 4px 4px 0 0;
    /* NEU: Längere Hover-Transitions für mehr Smoothness */
    transition: height 1.2s cubic-bezier(0.25, 1, 0.5, 1),
                width 1.2s cubic-bezier(0.25, 1, 0.5, 1),
                filter 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.6s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform-origin: bottom center;
}

/* NEUE FARBEN */
.health-column-bar.assets {
    background-color: #ffc93c !important;
}

html.light-mode .health-column-bar.assets {
    background-color: #d9534f !important;
}

.health-column-bar.liabilities {
    background-color: #8a99a9 !important;
}

html.light-mode .health-column-bar.liabilities {
    background-color: #adb5bd !important;
}

/* LABELS IN DEN SÄULEN */
.health-column-bar-label {
    color: #000000 !important;
    font-weight: 700;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.5s 1s, font-size 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.2;
    text-align: center;
    width: 100%;
    padding: 0 2px;
}

html.light-mode .health-column-bar-label {
    color: #000000 !important;
}

/* ÜBERSCHRIFTEN (Kurzfristig/Langfristig) */
.health-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff !important;
    text-align: center;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

html.light-mode .health-section-title {
    color: #000000 !important;
    text-shadow: none !important;
}

.health-date-footer {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    font-style: italic;
    opacity: 0.8;
}

/* NEU: VERBESSERTE SMOOTH HOVER-EFFEKTE */
.health-column:hover {
    transform: translateY(-3px); /* Etwas mehr Bewegung für besseren Effekt */
}

.health-column:hover .health-column-value {
    transform: translateY(-4px); /* Mehr Bewegung, aber smooth */
}

.health-column:hover .health-column-bar {
    filter: brightness(1.15);
    transform: scaleY(1.03) scaleX(1.02);
    /* box-shadow beim Hover entfernt */
}

/* NEU: Hover-Effekt für Labels */
.health-column:hover .health-column-bar-label {
    transform: scale(1.05); /* Leichte Vergrößerung des Labels */
}

/* NEU: Smooth Transition beim Verlassen des Hovers */
.health-column {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-column-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   13F Daten Tabellen-Styling
   ========================================================================== */

/* Haupttabelle */
#holders-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Gleichmäßige Spaltenbreiten */
}

/* Spaltenbreiten definieren */
#holders-table th:nth-child(1),
#holders-table td:nth-child(1) {
    width: 25%; /* Name des Fonds */
    text-align: left;
    padding-left: 1rem;
}

#holders-table th:nth-child(2),
#holders-table td:nth-child(2) {
    width: 12%; /* % des Portfolios */
    text-align: center;
}

#holders-table th:nth-child(3),
#holders-table td:nth-child(3) {
    width: 15%; /* Anteile */
    text-align: center;
}

#holders-table th:nth-child(4),
#holders-table td:nth-child(4) {
    width: 15%; /* Wert */
    text-align: center;
}

#holders-table th:nth-child(5),
#holders-table td:nth-child(5) {
    width: 13%; /* Letzte Aktivität */
    text-align: center;
}

#holders-table th:nth-child(6),
#holders-table td:nth-child(6) {
    width: 10%; /* Durchschnittspreis */
    text-align: center;
}

#holders-table th:nth-child(7),
#holders-table td:nth-child(7) {
    width: 10%; /* Meldedatum */
    text-align: center;
}

/* Header Styling */
/* NEU: Wenden Sie "sticky" auf den gesamten Tabellenkopf an */
#holders-table thead {
    position: -webkit-sticky; /* Für Safari */
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Header Styling */
#holders-table thead th {
    background-color: var(--panel-bg);
    color: var(--label-color);
    font-weight: bold;
    padding: 1rem 0.5rem;
    border-bottom: 2px solid var(--header-color);
    /* Die "position: sticky" Regel wurde von hier entfernt */
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Zellen Styling */
#holders-table tbody td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--panel-border);
    font-size: 14px;
    vertical-align: middle;
}

/* Fondsname hervorheben */
#holders-table tbody td:first-child {
    font-weight: 600;
    color: var(--text-color);
}

/* Zahlen-Formatierung */
#holders-table tbody td:nth-child(2),
#holders-table tbody td:nth-child(3),
#holders-table tbody td:nth-child(4),
#holders-table tbody td:nth-child(6) {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 500;
}

/* Positive/Negative Änderungen */
#holders-table .positive {
    color: var(--positive-color);
    font-weight: bold;
}

#holders-table .negative {
    color: var(--negative-color);
    font-weight: bold;
}

/* Hover-Effekt */
#holders-table tbody tr {
    transition: background-color 0.2s ease;
}

#holders-table tbody tr:hover {
    background-color: rgba(0, 191, 255, 0.05);
}

html.light-mode #holders-table tbody tr:hover {
    background-color: rgba(2, 117, 216, 0.05);
}

/* Zebra-Stripes für bessere Lesbarkeit */
#holders-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

html.light-mode #holders-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-container, .table-container-13f {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    position: relative;
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--label-color);
}

/* Responsive Anpassungen */
@media (max-width: 1200px) {
    #holders-table {
        font-size: 12px;
    }

    #holders-table thead th {
        padding: 0.8rem 0.4rem;
        font-size: 11px;
    }

    #holders-table tbody td {
        padding: 0.8rem 0.4rem;
    }
}

/* Loading State */
#holders-table tbody tr td[colspan] {
    text-align: center;
    padding: 2rem;
    color: var(--label-color);
    font-style: italic;
}


/* Markierung für das heutige Datum im Kalender */
.calendar-day-cell.today {
    background-color: rgba(128, 128, 128, 0.2);
    font-weight: bold;
    position: relative;
}

.calendar-day-cell.today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--header-color);
    border-radius: 50%;
}

/* Light Mode Anpassung */
html.light-mode .calendar-day-cell.today {
    background-color: rgba(128, 128, 128, 0.15);
}

/* In style.css (am Ende hinzufügen) */

/* Passt den Hauptcontainer des Panel-Headers an */
.panel-header {
    justify-content: space-between; /* Stellt sicher, dass Titel und Buttons auseinandergeschoben werden */
}

/* Neuer Container für Titel und den linksseitigen Filter */
.panel-header-title-container {
    display: flex;
    align-items: center; /* Zentriert Titel und Filter vertikal */
    gap: 1.5rem;         /* Abstand zwischen Titel und Filter-Dropdown */
    flex-grow: 1;        /* Nimmt den verfügbaren Platz ein */
}

/* Container für die Filter-Elemente (Label + Select) */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Abstand zwischen Label "Ansicht:" und dem Select-Feld */
}

/* Styling für das Label */
.filter-controls label {
    font-size: 13px;
    color: var(--label-color);
    font-weight: normal; /* Weniger dominant als der Titel */
    margin: 0;
}

/* Styling für das Select-Dropdown */
.filter-controls select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--panel-border);
    padding: 3px 8px; /* Kompakte Größe */
    font-family: var(--font-family);
    font-size: 13px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.filter-controls select:hover {
    border-color: var(--label-color);
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--header-color);
    box-shadow: 0 0 5px -1px var(--glow-color);
}

/* Light-Mode Anpassung */
html.light-mode .filter-controls select {
    background-color: #fff;
}


/* ==========================================================================
   11. 13F-Filter-Button Redesign (Größer & Schöner)
   ========================================================================== */

/* Wir zielen auf die neue Klasse .filter-dropdown, um nur diesen Knopf zu ändern. */
.filter-dropdown .custom-select-trigger {
    padding: 0.6rem 1rem; /* Mehr Innenabstand für mehr Größe */
    font-weight: 500;     /* Etwas fettere Schrift */
    letter-spacing: 0.5px; /* Sorgt für ein "designteres" Aussehen */
    line-height: 1.2;      /* Verbessert die vertikale Zentrierung */
    min-width: 180px;      /* Stellt eine gute Mindestbreite sicher */
    transition: all 0.25s ease-in-out; /* Weichere Übergänge */
}

/* Verbesserter Effekt, wenn man mit der Maus darüber fährt */
.filter-dropdown.custom-select-wrapper:hover .custom-select-trigger {
    border-color: var(--header-color); /* Rahmen in Akzentfarbe */
    background-color: var(--bg-color);   /* Hintergrund leicht ändern */
    color: var(--header-color);          /* Text in Akzentfarbe */
}

/* Der kleine Pfeil im Knopf soll sich beim Hover mitfärben */
.filter-dropdown.custom-select-wrapper:hover .custom-arrow {
    border-top-color: var(--header-color);
}

/* Wenn das Dropdown geöffnet ist, bekommt es einen deutlicheren Glow-Effekt */
.filter-dropdown .custom-select.open .custom-select-trigger {
    box-shadow: 0 0 10px -2px var(--glow-color);
    border-color: var(--header-color);
}

/* Spezifische Regel für Fund-Mode Headers */
#holders-table thead th {
    position: -webkit-sticky !important; /* Für Safari */
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background-color: var(--panel-bg) !important;
}

/* Stelle sicher, dass der thead selbst NICHT sticky ist */
#holders-table thead {
    position: static !important;
}


/* Fix für Fonds-Tabelle Headers mit Border */
.table-container-13f #holders-table thead tr {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background-color: var(--panel-bg) !important;
}

/* Stelle sicher, dass die orange Border bei den th-Elementen bleibt */
.table-container-13f #holders-table thead th {
    border: 1px solid var(--header-color) !important;
    background-color: var(--panel-bg) !important;
}


/* Klickbare Namen in den Tabellen */
#holders-table tbody td:first-child strong[onclick] {
    cursor: pointer;
    color: var(--label-color);
    transition: color 0.2s, text-decoration 0.2s;
    text-decoration: none;
}

#holders-table tbody td:first-child strong[onclick]:hover {
    color: var(--header-color);
    text-decoration: underline;
}

/* Light-Mode Anpassungen */
html.light-mode #holders-table tbody td:first-child strong[onclick] {
    color: var(--label-color);
}

html.light-mode #holders-table tbody td:first-child strong[onclick]:hover {
    color: var(--header-color);
}




/* ==========================================================================
   13F Daten Tabellen-Styling
   ========================================================================== */

/* Haupttabelle */
#holders-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Gleichmäßige Spaltenbreiten */
}

/* ==========================================================================
   13F KÄUFE VS. VERKÄUFE - NEUES DESIGN MIT ANIMATIONEN
   ========================================================================== */

/* Container für Käufer-Tabelle */
#buyers-table tbody tr {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#buyers-table tbody tr:hover {
    transform: translateX(5px);
    background-color: rgba(255, 201, 60, 0.08);
}

html.light-mode #buyers-table tbody tr:hover {
    background-color: rgba(217, 83, 79, 0.08);
}

/* Container für Verkäufer-Tabelle */
#sellers-table tbody tr {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#sellers-table tbody tr:hover {
    transform: translateX(5px);
    background-color: rgba(138, 153, 169, 0.08);
}

html.light-mode #sellers-table tbody tr:hover {
    background-color: rgba(173, 181, 189, 0.08);
}

/* ==========================================================================
   BUYS/SELLS BALKEN - IDENTISCH MIT PEER GROUP VALUATION
   ========================================================================== */

/* Basis-Styling für die Balken-Container */
.buys-sells-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.buys-sells-label {
    flex: 0 0 180px;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 600;
    /* IDENTISCH MIT PEERS: Transform nach rechts */
    transition: transform 0.2s ease;
}

.buys-sells-row:hover .buys-sells-label {
    /* IDENTISCH MIT PEERS: Bewegung nach rechts */
    transform: translateX(3px);
}

.buys-sells-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.buys-sells-bar-wrapper {
    display: flex;
    width: 100%;
    height: 35px;
    background-color: var(--panel-border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    /* IDENTISCH MIT PEERS: Transform nach rechts */
    transition: transform 0.2s ease;
}

.buys-sells-row:hover .buys-sells-bar-wrapper {
    /* IDENTISCH MIT PEERS: Bewegung nach rechts */
    transform: translateX(3px);
}

/* Die individuellen Balken */
.buys-bar, .sells-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-weight: 700;
    font-size: 1rem;
    /* IDENTISCH MIT PEERS: Gleiche Transitions */
    transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1),
                filter 0.2s ease,
                transform 0.2s ease;
    transform-origin: left center;
    position: relative;
}

/* IDENTISCH MIT PEERS: Hover-Effekte für die Balken */
.buys-sells-row:hover .buys-bar {
    filter: brightness(1.1);
    transform: scaleY(1.05);
}

.buys-sells-row:hover .sells-bar {
    filter: brightness(1.1);
    transform: scaleY(1.05);
}

/* Zahl am Ende der Zeile */
.buys-sells-count {
    flex: 0 0 60px;
    text-align: right;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
    /* IDENTISCH MIT PEERS: Transform nach rechts */
    transition: transform 0.2s ease;
}

.buys-sells-row:hover .buys-sells-count {
    /* IDENTISCH MIT PEERS: Bewegung nach rechts */
    transform: translateX(3px);
}

/* Header und Legende */
.buys-sells-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

.buys-sells-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--header-color);
}

.buys-sells-legend {
    display: flex;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

/* Animation beim Laden - identisch mit Peers */
@keyframes barSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.buys-sells-row {
    opacity: 0;
    transform: translateX(-10px);
    animation: barSlideIn 0.5s ease-out forwards;
}

.buys-sells-row:nth-child(2) { animation-delay: 0.07s; }
.buys-sells-row:nth-child(3) { animation-delay: 0.14s; }
.buys-sells-row:nth-child(4) { animation-delay: 0.21s; }

/* Käufer-Wert-Zellen mit neuer Farbe */
#buyers-table tbody td:nth-child(3) { /* KAUFWERT */
    color: #ffc93c !important;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease;
}

html.light-mode #buyers-table tbody td:nth-child(3) {
    color: #d9534f !important;
}

#buyers-table tbody tr:hover td:nth-child(3) {
    transform: scale(1.05);
    text-shadow: 0 0 8px rgba(255, 201, 60, 0.4);
}

html.light-mode #buyers-table tbody tr:hover td:nth-child(3) {
    text-shadow: 0 0 8px rgba(217, 83, 79, 0.4);
}

/* Verkäufer-Wert-Zellen mit grauer Farbe */
#sellers-table tbody td:nth-child(3) { /* VERKAUFSWERT */
    color: #8a99a9 !important;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease;
}

html.light-mode #sellers-table tbody td:nth-child(3) {
    color: #adb5bd !important;
}

#sellers-table tbody tr:hover td:nth-child(3) {
    transform: scale(1.05);
    text-shadow: 0 0 8px rgba(138, 153, 169, 0.4);
}

html.light-mode #sellers-table tbody tr:hover td:nth-child(3) {
    text-shadow: 0 0 8px rgba(173, 181, 189, 0.4);
}

/* Animierte Änderungs-Pfeile */
#buyers-table .positive,
#sellers-table .negative {
    transition: all 0.3s ease;
    display: inline-block;
}

#buyers-table tbody tr:hover .positive {
    transform: translateY(-2px) scale(1.1);
    color: #ffc93c;
    text-shadow: 0 0 10px rgba(255, 201, 60, 0.5);
}

html.light-mode #buyers-table tbody tr:hover .positive {
    color: #d9534f;
    text-shadow: 0 0 10px rgba(217, 83, 79, 0.5);
}

#sellers-table tbody tr:hover .negative {
    transform: translateY(2px) scale(1.1);
    color: #8a99a9;
    text-shadow: 0 0 10px rgba(138, 153, 169, 0.5);
}

html.light-mode #sellers-table tbody tr:hover .negative {
    color: #adb5bd;
    text-shadow: 0 0 10px rgba(173, 181, 189, 0.5);
}

/* Hover-Effekt für Investoren-Namen */
#buyers-table tbody td:first-child strong,
#sellers-table tbody td:first-child strong {
    transition: all 0.3s ease;
}

#buyers-table tbody tr:hover td:first-child strong {
    color: #ffc93c;
}

html.light-mode #buyers-table tbody tr:hover td:first-child strong {
    color: #d9534f;
}

#sellers-table tbody tr:hover td:first-child strong {
    color: #8a99a9;
}

html.light-mode #sellers-table tbody tr:hover td:first-child strong {
    color: #adb5bd;
}

/* Animierte Überschriften */
h3:has(+ #buyers-table) {
    position: relative;
    overflow: hidden;
}

h3:has(+ #buyers-table)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffc93c, transparent);
    animation: shimmer 3s infinite;
}

html.light-mode h3:has(+ #buyers-table)::after {
    background: linear-gradient(90deg, transparent, #d9534f, transparent);
}

h3:has(+ #sellers-table)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8a99a9, transparent);
    animation: shimmer 3s infinite;
}

html.light-mode h3:has(+ #sellers-table)::after {
    background: linear-gradient(90deg, transparent, #adb5bd, transparent);
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Hover-Effekt für Anteile-Spalten */
#buyers-table tbody td:nth-child(2),
#sellers-table tbody td:nth-child(2) {
    transition: all 0.3s ease;
}

#buyers-table tbody tr:hover td:nth-child(2),
#sellers-table tbody tr:hover td:nth-child(2) {
    font-weight: bold;
    transform: scale(1.05);
}

/* Hover-Effekt für Durchschnittspreis */
#buyers-table tbody td:nth-child(5),
#sellers-table tbody td:nth-child(5) {
    transition: all 0.3s ease;
}

#buyers-table tbody tr:hover td:nth-child(5):not(:contains('N/A')) {
    color: var(--header-color);
    font-weight: bold;
}




/* ==========================================================================
   28. Valuation Summary Panel - Checkpoint System
   ========================================================================== */

#valuation-summary-panel {
    margin-bottom: 2rem;
}

.summary-score-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    background-color: var(--bg-color);
    border-radius: 20px;
    border: 1px solid var(--panel-border);
}

.score-label {
    font-size: 12px;
    color: var(--label-color);
}

.score-value {
    font-size: 16px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.score-value.excellent {
    color: var(--positive-color);
    text-shadow: 0 0 8px rgba(0, 255, 127, 0.4);
}

.score-value.good {
    color: #ffc93c;
    text-shadow: 0 0 8px rgba(255, 201, 60, 0.4);
}

.score-value.neutral {
    color: var(--label-color);
}

.score-value.poor {
    color: var(--negative-color);
    text-shadow: 0 0 8px rgba(255, 71, 87, 0.4);
}

/* Checkpoint Grid */
.checkpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.checkpoint-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUpFadeIn 0.5s ease-out forwards;
}

.checkpoint-item:nth-child(1) { animation-delay: 0.1s; }
.checkpoint-item:nth-child(2) { animation-delay: 0.2s; }
.checkpoint-item:nth-child(3) { animation-delay: 0.3s; }
.checkpoint-item:nth-child(4) { animation-delay: 0.4s; }

.checkpoint-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Checkpoint Icons */
.checkpoint-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--panel-border);
    position: relative;
}

.checkpoint-icon svg {
    width: 24px;
    height: 24px;
    display: none;
    animation: iconPop 0.3s ease-out;
}

@keyframes iconPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Status-spezifische Icon-Stile */
.checkpoint-item.passed .checkpoint-icon {
    background-color: rgba(0, 255, 127, 0.2);
    border: 2px solid var(--positive-color);
}

.checkpoint-item.passed .checkmark {
    display: block;
    fill: var(--positive-color);
}

.checkpoint-item.failed .checkpoint-icon {
    background-color: rgba(255, 71, 87, 0.2);
    border: 2px solid var(--negative-color);
}


.checkpoint-item.failed .cross {
    display: block;
    fill: var(--negative-color);
    stroke: none; /* Entfernt mögliche Stroke-Eigenschaften */
    stroke-width: 0;
}


.checkpoint-item.warning .checkpoint-icon {
    background-color: rgba(255, 201, 60, 0.2);
    border: 2px solid #ffc93c;
}

.checkpoint-item.warning .warning {
    display: block;
    fill: #ffc93c;
}

/* Checkpoint Content */
.checkpoint-content h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
    font-size: 14px;
}

.checkpoint-status {
    margin: 0 0 0.25rem 0;
    font-size: 12px;
    font-weight: 600;
}

.checkpoint-item.passed .checkpoint-status {
    color: var(--positive-color);
}

.checkpoint-item.failed .checkpoint-status {
    color: var(--negative-color);
}

.checkpoint-item.warning .checkpoint-status {
    color: #ffc93c;
}

.checkpoint-detail {
    font-size: 11px;
    color: var(--label-color);
    opacity: 0.8;
}

/* Empfehlungsbox */
.recommendation-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--panel-border) 100%);
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(10px);
    animation: slideUpFadeIn 0.5s ease-out 0.5s forwards;
}

/* Empfehlungs-Icon Anpassungen */
.recommendation-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: all 0.3s ease;
}

/* Verschiedene Farben je nach Empfehlung */
.recommendation-box.buy-strong .recommendation-icon {
    color: var(--positive-color);
}

.recommendation-box.buy-moderate .recommendation-icon {
    color: #ffc93c;
}

.recommendation-box.hold .recommendation-icon {
    color: var(--label-color);
}

.recommendation-box.sell .recommendation-icon {
    color: var(--negative-color);
}

/* Hover-Effekt für das Icon */
.recommendation-box:hover .recommendation-icon svg {
    transform: scale(1.1);
}

/* Spezielle Animation nur für starken Kauf (Rakete) */
@keyframes rocket-boost {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

.recommendation-box.buy-strong .recommendation-icon svg {
    animation: rocket-boost 2s ease-in-out infinite;
}

/* Animation für Hold (Pulse) */
@keyframes hold-pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.recommendation-box.hold .recommendation-icon svg {
    animation: hold-pulse 2s ease-in-out infinite;
}

/* Animation für Sell (leichtes Schütteln) */
@keyframes warning-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.recommendation-box.sell .recommendation-icon svg {
    animation: warning-shake 3s ease-in-out infinite;
}

/* Light Mode Anpassungen */
html.light-mode .recommendation-box.buy-moderate .recommendation-icon {
    color: #d9534f;
}

.recommendation-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: bold;
}

.recommendation-box.buy-strong h3 {
    color: var(--positive-color);
}

.recommendation-box.buy-moderate h3 {
    color: #ffc93c;
}

.recommendation-box.hold h3 {
    color: var(--label-color);
}

.recommendation-box.sell h3 {
    color: var(--negative-color);
}

.recommendation-content p {
    margin: 0;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

/* Light Mode Anpassungen */
html.light-mode .recommendation-box.buy-moderate .recommendation-icon {
    color: #d9534f;
}

html.light-mode .checkpoint-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

html.light-mode .recommendation-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

html.light-mode .score-value.good {
    color: #d9534f;
    text-shadow: 0 0 8px rgba(217, 83, 79, 0.4);
}

html.light-mode .checkpoint-item.warning .checkpoint-icon {
    background-color: rgba(217, 83, 79, 0.2);
    border: 2px solid #d9534f;
}

html.light-mode .checkpoint-item.warning .warning {
    fill: #d9534f;
}

html.light-mode .checkpoint-item.warning .checkpoint-status {
    color: #d9534f;
}

html.light-mode .recommendation-box.buy-moderate .recommendation-icon svg {
    fill: #d9534f;
}

html.light-mode .recommendation-box.buy-moderate h3 {
    color: #d9534f;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .checkpoint-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .checkpoint-grid {
        grid-template-columns: 1fr;
    }

    .recommendation-box {
        flex-direction: column;
        text-align: center;
    }
}

#valuation-summary-panel .panel-content {
    padding-bottom: 0.8rem;
}



/* ==========================================================================
   26. Valuation Page - Peer Group Panel (Kein Scrollen)
   ========================================================================== */

/* Verhindert Scrollen im Peer Valuation Panel */
#peer-valuation-panel {
    overflow: hidden !important;
}

#peer-valuation-panel .panel-content {
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    -ms-overflow-style: none;  /* IE und Edge */
    scrollbar-width: none;      /* Firefox */
}

/* Versteckt Scrollbars in Webkit-Browsern (Chrome, Safari) */
#peer-valuation-panel .panel-content::-webkit-scrollbar {
    display: none;
}

/* Stellt sicher, dass der Container selbst auch kein Scrollen erlaubt */
#peer-comparison-container {
    overflow: hidden !important;
    max-height: none !important;
}

/* Entfernt jegliche Height-Beschränkungen, die Scrollen verursachen könnten */
.peer-chart-container {
    overflow: hidden !important;
    max-height: none !important;
}

.peer-chart-bar-list {
    overflow: hidden !important;
    max-height: none !important;
}



/* ==========================================================================
   LANDINGPAGE-ERWEITERUNGEN (am Ende von home.css einfügen)
   ========================================================================== */

/* -- Neue Header-Buttons -- */
.main-header .btn.btn-secondary-outline {
    background-color: transparent;
    border: 2px solid var(--header-color); /* FMP: --header-color ist #ffc93c */
    color: var(--header-color);
    padding: 8px 22px;
}

.main-header .btn.btn-secondary-outline:hover {
    background-color: var(--header-color);
    color: var(--bg-color); /* FMP: --bg-color ist #0a0a0a */
}


/* -- Neue Hero-Buttons -- */
.hero-buttons .btn.btn-tertiary {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.hero-buttons .btn.btn-tertiary:hover {
  background-color: #fff;
  color: #0a0a0a;
  border-color: #fff;
}


/* -- Preis-Sektion -- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 3rem auto 0;
    justify-content: center;
}

.pricing-card {
    background-color: var(--panel-bg); /* FMP: --panel-bg ist #161618 */
    border: 1px solid var(--panel-border); /* FMP: --panel-border ist #2c2c2e */
    border-radius: 10px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.pricing-card.popular {
    border-color: var(--header-color);
    box-shadow: 0 0 25px -5px var(--glow-color); /* FMP: --glow-color ist rgba(0, 191, 255, 0.45) */
}

.popular-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--header-color);
    color: var(--bg-color);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-bottom-left-radius: 10px;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price-tag {
    margin-bottom: 2rem;
}

/* HIER IST DIE WICHTIGE ÄNDERUNG */
.price-tag .price {
    font-size: 3rem;
    font-weight: 700;
    color: #ffc93c !important; /* Standardmäßig orange */
    transition: color 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-8px);
    border-color: var(--text-color);
    background: rgba(22, 33, 62, 0.95);
    box-shadow: 0 15px 40px rgba(230, 162, 15, 0.2);
}
.pricing-card:hover .price-tag .price {
    color: #ffffff !important;
}
}
.price-tag .period {
    font-size: 1rem;
    color: #999;
    margin-left: 0.5rem;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
    width: 100%;
}

.features-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--panel-border);
}

.features-list li:first-child {
    border-top: 1px solid var(--panel-border);
}

.pricing-card .btn {
    width: 100%;
    margin-top: auto; /* Button am unteren Rand ausrichten */
}

/* -- FAQ-Sektion -- */
.faq-container {
    max-width: 800px;
    margin: 3rem auto 0;
    border-top: 1px solid var(--panel-border);
}

.faq-item {
    border-bottom: 1px solid var(--panel-border);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-color); /* FMP: --text-color ist #e8e8e8 */
    padding: 1.5rem 1rem;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.faq-answer p {
    padding: 0 1rem 1.5rem 1rem;
    margin: 0;
    color: #ccc;
    line-height: 1.7;
}

/* Icon für Auf/Zu */
.faq-icon {
    width: 1.2em;
    height: 1.2em;
    transition: transform 0.3s ease;
    position: relative;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background-color: var(--label-color); /* FMP: --label-color ist #00bfff */
    transition: transform 0.3s ease-out;
}

.faq-icon::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}
.faq-icon::after {
    left: 50%;
    top: 0;
    height: 100%;
    width: 2px;
    transform: translateX(-50%);
}

/* Ändert Plus zu Minus wenn aktiv */
.faq-question.active .faq-icon::after {
    transform: translateX(-50%) rotate(90deg);
}

.faq-question.active .faq-icon {
    transform: rotate(180deg);
}


/* ==========================================================================
   29. Sticky Header für Yearly Results Tabelle
   ========================================================================== */

/* Container mit fester Höhe und Scrollbar */
.yearly-panel .table-container {
    max-height: 400px; /* Größeres Fenster für mehr sichtbare Einträge */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Sticky Header Styling */
.yearly-panel table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--panel-bg);
}

/* Light Mode Anpassung */
html.light-mode .yearly-panel table thead {
    background-color: var(--panel-bg);
}

/* Zusätzlicher Schatten für bessere Abgrenzung beim Scrollen */
.yearly-panel thead::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(to right,
        transparent,
        var(--header-color) 20%,
        var(--header-color) 80%,
        transparent
    );
    opacity: 0.5;
}

/* Verbesserte Scrollbar für Dark Mode */
.yearly-panel .table-container::-webkit-scrollbar {
    width: 8px;
}

.yearly-panel .table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.yearly-panel .table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.yearly-panel .table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Light Mode Scrollbar */
html.light-mode .yearly-panel .table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

html.light-mode .yearly-panel .table-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

html.light-mode .yearly-panel .table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}



/* ==========================================================================
   30. Fix für Chart-Container Sprungverhalten
   ========================================================================== */

/* Feste Mindesthöhe für den Chart-Container */
.chart-panel .panel-content {
    min-height: 400px; /* Verhindert das Kollabieren beim Neuzeichnen */
    position: relative;
}

/* Feste Höhe für das Canvas-Element */
#seasonal-chart {
    min-height: 350px;
    height: 100%;
    width: 100%;
    display: block; /* Wichtig für konsistente Größenberechnung */
}

/* Container für das Chart behält seine Größe während Updates */
.chart-panel {
    min-height: 450px; /* Gesamthöhe des Panels - BEHALTEN! */
    min-width: 0;      /* NEU HINZUFÜGEN */
    max-width: 100%;   /* NEU HINZUFÜGEN */
    overflow: hidden;  /* NEU HINZUFÜGEN */
}

/* Verhindert Layout-Shifts beim Stats-Update */
#stats-output {
    min-height: 240px; /* Bereits vorhanden in der CSS, aber zur Sicherheit */
}

/* Verhindert Sprünge beim Tabellen-Update */
.yearly-panel {
    min-height: 220px; /* Bereits definiert als footer min-height */
}

/* Smooth Scroll Behavior für die gesamte Seite */
html {
    scroll-behavior: auto; /* Deaktiviert smooth scrolling, was Sprünge verursachen kann */
}


/* ==========================================================================
   COT Report - Fixed Header Table Styling
   ========================================================================== */

/* Entfernt das alte Sticky-Verhalten */
.cot-table thead tr:first-child th,
.cot-table thead tr:nth-child(2) th,
.cot-table .report-date {
    position: static !important;
}

/* Wrapper für die gesamte Tabelle */
.cot-table-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Fester Header-Bereich (nicht scrollbar) */
.cot-table-header {
    flex-shrink: 0;
    background: var(--bg-primary, #1a1a1b);
    border-bottom: 2px solid var(--header-color);
}

/* Scrollbarer Body-Bereich */
.cot-table-body-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
}

/* Tabelle im Header */
.cot-table-header table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

/* Tabelle im Body */
.cot-table-body-wrapper table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

/* Synchronisierte Spaltenbreiten */
.cot-table-header th,
.cot-table-body-wrapper td {
    padding: 0.5rem;
    text-align: right;
    border: 1px solid var(--border-color, #3a3a3c);
}

.cot-table-header th:first-child,
.cot-table-body-wrapper td:first-child {
    text-align: left;
    font-weight: bold;
    background: var(--bg-tertiary, #0f0f10);
    width: 150px; /* Feste Breite für erste Spalte */
}

/* Legacy Report spezifische Spaltenbreiten */
#cot-legacy-table .cot-table-header th:nth-child(n+2),
#cot-legacy-table .cot-table-body-wrapper td:nth-child(n+2) {
    width: calc((100% - 150px) / 9); /* Gleichmäßige Verteilung der restlichen Spalten */
}

/* TFF Report spezifische Spaltenbreiten */
#cot-tff-table .cot-table-header th:nth-child(n+2),
#cot-tff-table .cot-table-body-wrapper td:nth-child(n+2) {
    width: calc((100% - 150px) / 10);
}

/* Disaggregated Report spezifische Spaltenbreiten */
#cot-disaggregated-table .cot-table-header th:nth-child(n+2),
#cot-disaggregated-table .cot-table-body-wrapper td:nth-child(n+2) {
    width: calc((100% - 150px) / 10);
}

/* Header Styles bleiben unverändert */
.header-main {
    background: var(--bg-tertiary, #0f0f10) !important;
    font-weight: bold;
}

.header-group {
    background: var(--bg-secondary, #1a1a1b) !important;
    text-align: center !important;
    font-weight: bold;
}

/* Report-Datum als erste Zeile im Body */
.report-date {
    background: var(--bg-tertiary, #0f0f10) !important;
    text-align: center !important;
    font-size: 0.9em;
}

/* Scrollbar Styling */
.cot-table-body-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.cot-table-body-wrapper::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.cot-table-body-wrapper::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}

.cot-table-body-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--label-color);
}

/* Light Mode Anpassungen */
.light-mode .cot-table-header {
    background: #ffffff;
}

.light-mode .cot-table-header table,
.light-mode .cot-table-body-wrapper table {
    background: #ffffff;
}

.light-mode .cot-table-header th,
.light-mode .cot-table-body-wrapper td {
    border-color: #dee2e6;
}

.light-mode .cot-table-header th:first-child,
.light-mode .cot-table-body-wrapper td:first-child,
.light-mode .header-main {
    background: #e9ecef !important;
}

.light-mode .header-group {
    background: #f8f9fa !important;
}

.light-mode .report-date {
    background: #e9ecef !important;
}

/* Panel Content Anpassung */
.cot-data-panel .panel-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    padding: 0;
    overflow: hidden;
}




/* ==========================================================================
   COT Report - Responsive Table Styling (FIXED)
   ========================================================================== */

/* Panel Content */
.cot-data-panel .panel-content {
    padding: 0.8rem;
    overflow-y: auto !important;
    overflow-x: hidden;
    max-height: calc(100vh - 250px);
    min-height: 400px;
    position: relative;
}

/* Container für jede Tabelle */
.cot-table-container {
    margin-bottom: 2rem;
    background: var(--bg-primary, #1a1a1b);
    border: 1px solid var(--border-color, #3a3a3c);
    border-radius: 4px;
    overflow: hidden;
}

/* Wrapper OHNE Höhenbeschränkungen */
.cot-table-wrapper {
    display: block; /* Geändert von flex zu block */
}

/* Fester Header-Bereich */
.cot-table-header {
    background: var(--bg-primary, #1a1a1b);
    border-bottom: 2px solid var(--header-color);
}

/* Scrollbarer Body-Bereich OHNE Höhe */
.cot-table-body-wrapper {
    overflow-x: auto;
    /* KEIN overflow-y und KEINE height! */
}

/* Tabellen Grundstyles */
.cot-table {
    width: 100%;
    border-collapse: collapse !important; /* WICHTIG */
    border-spacing: 0 !important;
    background: var(--bg-primary, #1a1a1b);
    min-width: 900px;
    margin: 0 !important;
    padding: 0 !important;
}

.cot-table th,
.cot-table td {
    padding: 0.5rem;
    text-align: right;
    border: 1px solid var(--border-color, #3a3a3c);
    margin: 0 !important;
}

.cot-table th:first-child,
.cot-table td:first-child {
    text-align: left;
    font-weight: bold;
    background: var(--bg-tertiary, #0f0f10);
    width: 150px;
    position: sticky;
    left: 0;
    z-index: 1;
}

/* Abschluss-Border außerhalb der Tabelle */
.cot-table-container {
    border-bottom: 2px solid var(--header-color);
    margin-bottom: 2rem;
}

/* Entfernt alle Margins und Paddings */
.cot-table tbody {
    margin: 0 !important;
    padding: 0 !important;
}

.cot-table tbody tr {
    margin: 0 !important;
    padding: 0 !important;
}

/* Header-Styles */
.header-main {
    background: var(--bg-tertiary, #0f0f10) !important;
    font-weight: bold;
}

.header-group {
    background: var(--bg-secondary, #1a1a1b) !important;
    text-align: center !important;
    font-weight: bold;
}

/* Datumszeile */
.report-date {
    background: var(--bg-tertiary, #0f0f10) !important;
    text-align: center !important;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--header-color);
}

/* Farben */
.positive { color: #4ade80; }
.negative { color: #f87171; }

/* Net Positions */
.net-position-cell {
    text-align: center !important;
}

.net-position-cell div:first-child {
    font-weight: bold;
    font-size: 1.1em;
}

.net-position-cell div:last-child {
    font-size: 0.9em;
    margin-top: 0.2rem;
}

/* Scrollbar Styling */
.cot-table-body-wrapper::-webkit-scrollbar,
.cot-data-panel .panel-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.cot-table-body-wrapper::-webkit-scrollbar-track,
.cot-data-panel .panel-content::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.cot-table-body-wrapper::-webkit-scrollbar-thumb,
.cot-data-panel .panel-content::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}

.cot-table-body-wrapper::-webkit-scrollbar-thumb:hover,
.cot-data-panel .panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--label-color);
}

/* Responsive Anpassungen */
@media (max-width: 1400px) {
    .cot-table {
        font-size: 12px;
    }
}

@media (max-width: 1200px) {
    .cot-data-panel .panel-content {
        max-height: calc(100vh - 200px);
    }

    .cot-table th,
    .cot-table td {
        padding: 0.4rem;
    }
}

@media (max-width: 768px) {
    .cot-main-grid {
        grid-template-columns: 1fr;
    }

    .futures-selection-panel {
        display: none;
    }

    .cot-table {
        font-size: 11px;
        min-width: 700px;
    }
}

/* Light Mode Anpassungen */
.light-mode .cot-table-container {
    background: #ffffff;
    border-color: #dee2e6;
}

.light-mode .cot-table-header {
    background: #ffffff;
}

.light-mode .cot-table {
    background: #ffffff;
}

.light-mode .cot-table th,
.light-mode .cot-table td {
    border-color: #dee2e6;
}

.light-mode .cot-table th:first-child,
.light-mode .cot-table td:first-child {
    background: #e9ecef !important;
}

.light-mode .header-main {
    background: #e9ecef !important;
}

.light-mode .header-group {
    background: #f8f9fa !important;
}

.light-mode .report-date {
    background: #e9ecef !important;
}



/* ==========================================================================
   COT Report - Fix für leere Zeile unter Tabellen
   ========================================================================== */
.cot-table-wrapper {
    background: transparent !important;
}

/* Entfernt die zusätzliche leere Zeile unter den Net Positionen */
.cot-table-body-wrapper {
    /* Entfernt jeglichen zusätzlichen Raum nach der letzten Zeile */
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.cot-table tbody tr:last-child {
    /* Stellt sicher, dass die letzte Zeile (Net Positionen) keinen zusätzlichen Abstand hat */
    margin-bottom: 0 !important;
}

.cot-table-container {
    /* Entfernt den unteren Border, der wie eine leere Zeile aussehen könnte */
    border-bottom: none !important;
}


/* ==========================================================================
   Screener Results Table - Fix für Header-Überlappung
   ========================================================================== */
#screener-results-table {
    border-collapse: separate;
    border-spacing: 0;
}

#screener-results-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

#screener-results-table thead tr {
    background-color: var(--panel-bg);
}

#screener-results-table thead th {
    background-color: var(--panel-bg);
    border-bottom: 2px solid var(--header-color);
    position: relative;
    padding: 0.8rem 0.5rem;
}

/* Fügt einen Schatten unter dem Header hinzu für bessere Trennung */
#screener-results-table thead::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
}

/* Light Mode Anpassungen */
html.light-mode #screener-results-table thead tr,
html.light-mode #screener-results-table thead th {
    background-color: var(--panel-bg);
}

/* Zusätzlicher Abstand zwischen Header und ersten Ergebnissen */
#screener-results-table tbody tr:first-child td {
    padding-top: 1rem;
}



/* ==========================================================================
   Screener Results - Vollständige Höhennutzung (OVERRIDE)
   ========================================================================== */

/* Überschreibt das inline style="max-height: 70vh" */
#basket-content-display .table-container {
    max-height: 100% !important;
    height: calc(100vh - 250px) !important; /* Anpassung basierend auf Header und Controls */
}

/* Hauptgrid nutzt volle Höhe */
.screener-main-grid {
    height: calc(100vh - 120px); /* Abzug für Header und Padding */
}

/* Results Panel nutzt volle Höhe */
.screener-results {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.screener-results .panel-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Table Container für Ergebnisse */
.screener-results .table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    max-height: none !important;
    height: 100% !important;
}

/* Spezifisch für die Screener-Ergebnistabelle */
#screener-results-table {
    height: auto;
}

/* Basket Preview auch volle Höhe */
#selected-basket-preview-table {
    height: auto;
}



/* Fix für 13F View Control Buttons */
#holder-view-controls {
    display: flex !important;
    gap: 0.5rem !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

#holder-view-controls .control-button {
    padding: 6px 16px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex: none !important;
    width: auto !important;
}

.panel-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.panel-header-title-container {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
}






/* Fix für Dropdown-Menü Z-Index und Overflow */
.panel-header {
    position: relative;
    overflow: visible !important;
}

.filter-controls {
    position: relative;
    z-index: 100;
}

.custom-dropdown {
    position: relative;
    z-index: 1001;
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--panel-bg);
    border: 2px solid var(--header-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999 !important; /* Erhöhter Z-Index */
    overflow: hidden;
    min-width: 180px;
}

/* Stelle sicher, dass der Panel-Content das Dropdown nicht abschneidet */
.panel {
    overflow: visible !important;
}

.panel-content {
    position: relative;
    z-index: 1;
}



/* Entferne den Haken bei Dropdown-Optionen */
.dropdown-option.active::before {
    display: none !important;
}

/* Oder wenn Sie den Haken nur für diese spezielle Option entfernen möchten */
.dropdown-option::before {
    content: '' !important;
}
/* MACRO.CSS - Füge diese Styles zu deiner macro.html oder in eine separate CSS-Datei ein */

/* Container für die Makro-Indikatoren */
.macro-indicators-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Jeder Indikator Block */
.indicator-section {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Chart Container - WICHTIGER FIX */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden; /* Verhindert horizontales Scrollen */
}

/* Canvas Element für Charts */
.chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Iframe Container für TradingView oder andere eingebettete Charts */
.chart-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}

/* Responsive Grid für die Kontrollen */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Select Dropdowns */
.custom-select {
    width: 100%;
    max-width: 250px;
}

/* Dark Mode Anpassungen */
[data-theme="dark"] .indicator-section {
    background: #1a1a1a;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .chart-container {
    background: #0d0d0d;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .macro-indicators-container {
        padding: 10px;
    }

    .chart-container {
        height: 300px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }
}

/* Verhindere horizontales Scrollen auf der gesamten Seite */
body {
    overflow-x: hidden;
}

.main-content {
    overflow-x: hidden;
    max-width: 100vw;
}






/* ==========================================================================
   MACRO PAGE FIXES - Füge dies am Ende von style.css hinzu
   ========================================================================== */

/* Fix für zu breite Select-Felder auf der Macro-Seite */
.controls-section .custom-select-wrapper {
    max-width: 250px !important;
}

.controls-section > div {
    flex: 1;
    min-width: 200px;
    max-width: 300px; /* Begrenzt die maximale Breite */
}

/* Verhindert horizontales Scrollen der gesamten Seite */
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.terminal-container {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Stellt sicher, dass die Chart-Container korrekt funktionieren */
#chart-container,
#gdp-chart-container,
#cpi-chart-container {
    overflow: hidden !important; /* Wichtig: nicht visible! */
    position: relative;
    max-width: 100%;
}

/* Scrollbare Wrapper innerhalb der Container */
.chart-scroll-wrapper {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    position: relative !important;
}

/* Scrollbar-Styling für die Chart-Container */
.chart-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.chart-scroll-wrapper::-webkit-scrollbar-track {
    background: var(--panel-bg);
    border-radius: 4px;
}

.chart-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}

.chart-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--label-color);
}

/* Light Mode Anpassungen */
html.light-mode .chart-scroll-wrapper::-webkit-scrollbar-track {
    background: #f8f9fa;
}

html.light-mode .chart-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #dee2e6;
}

html.light-mode .chart-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--label-color);
}





/* CRITICAL FIX für Macro-Seite Scrolling */
.chart-scroll-wrapper {
    overflow-x: scroll !important; /* FORCE scroll, nicht auto */
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
}

/* Stelle sicher, dass der Content breiter ist */
.chart-wrapper {
    width: 8000px !important;
    min-width: 8000px !important;
}

/* Verhindere, dass Parent-Container das Scrolling blockieren */
#chart-container,
#gdp-chart-container,
#cpi-chart-container {
    overflow: hidden !important;
    position: relative !important;
}




/* ==========================================================================
   MACRO PAGE SCROLL FIX - Am Ende von style.css hinzufügen
   ========================================================================== */

/* Hauptcontainer dürfen NICHT scrollen */
#chart-container,
#gdp-chart-container,
#cpi-chart-container {
    overflow: hidden !important;
    position: relative !important;
    height: 500px !important;
    display: flex !important;
}

/* Direktes Child nach Y-Achse MUSS scrollen */
#chart-container > div:last-child,
#gdp-chart-container > div:last-child,
#cpi-chart-container > div:last-child {
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    flex: 1 !important;
    height: 470px !important;
    margin-top: 30px !important;
    max-width: calc(100% - 70px) !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
}

/* Scrollbar immer sichtbar machen */
#chart-container > div:last-child::-webkit-scrollbar,
#gdp-chart-container > div:last-child::-webkit-scrollbar,
#cpi-chart-container > div:last-child::-webkit-scrollbar {
    height: 8px !important;
    display: block !important;
}

#chart-container > div:last-child::-webkit-scrollbar-track,
#gdp-chart-container > div:last-child::-webkit-scrollbar-track,
#cpi-chart-container > div:last-child::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
}

#chart-container > div:last-child::-webkit-scrollbar-thumb,
#gdp-chart-container > div:last-child::-webkit-scrollbar-thumb,
#cpi-chart-container > div:last-child::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
}

#chart-container > div:last-child::-webkit-scrollbar-thumb:hover,
#gdp-chart-container > div:last-child::-webkit-scrollbar-thumb:hover,
#cpi-chart-container > div:last-child::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Chart-Wrapper mit Canvas MUSS breit sein */
.chart-wrapper,
#chart-container > div:last-child > div,
#gdp-chart-container > div:last-child > div,
#cpi-chart-container > div:last-child > div {
    width: 8000px !important;
    min-width: 8000px !important;
    height: 100% !important;
    position: relative !important;
}

/* Canvas selbst */
#momentum-chart,
#gdp-momentum-chart,
#cpi-momentum-chart {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: block !important;
}

/* Falls die Klasse chart-scroll-wrapper existiert */
.chart-scroll-wrapper {
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    max-width: 100% !important;
    height: 470px !important;
}

/* Y-Achsen Container */
.y-axis-container {
    width: 60px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    height: 470px !important;
    margin-top: 30px !important;
}

/* Legende über allem */
[class*="fixed-legend-"] {
    z-index: 10000 !important;
    position: absolute !important;
    top: 5px !important;
}

/* Light Mode Anpassungen */
html.light-mode #chart-container > div:last-child::-webkit-scrollbar-track,
html.light-mode #gdp-chart-container > div:last-child::-webkit-scrollbar-track,
html.light-mode #cpi-chart-container > div:last-child::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05) !important;
}

html.light-mode #chart-container > div:last-child::-webkit-scrollbar-thumb,
html.light-mode #gdp-chart-container > div:last-child::-webkit-scrollbar-thumb,
html.light-mode #cpi-chart-container > div:last-child::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
}

html.light-mode #chart-container > div:last-child::-webkit-scrollbar-thumb:hover,
html.light-mode #gdp-chart-container > div:last-child::-webkit-scrollbar-thumb:hover,
html.light-mode #cpi-chart-container > div:last-child::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Firefox Scrollbar Support */
@supports (scrollbar-width: thin) {
    #chart-container > div:last-child,
    #gdp-chart-container > div:last-child,
    #cpi-chart-container > div:last-child,
    .chart-scroll-wrapper {
        scrollbar-width: thin !important;
        scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1) !important;
    }

    html.light-mode #chart-container > div:last-child,
    html.light-mode #gdp-chart-container > div:last-child,
    html.light-mode #cpi-chart-container > div:last-child,
    html.light-mode .chart-scroll-wrapper {
        scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05) !important;
    }
}





/* NEUER HEADER CODE - Sicherer und responsive */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;  /* Verhindert Überlauf */
    max-width: 100vw;
}

.header-logo {
    flex: 0 0 auto;
    max-width: 200px;
}

.header-info {
    flex: 0 0 auto;
    margin-left: auto;
}

header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    text-align: center;
    padding: 0 1rem;
    max-width: 50%;
}

/* Zusätzliche Sicherheit gegen Layout-Probleme */
.terminal-container {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Responsive Anpassung für kleinere Bildschirme */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    header h1 {
        position: static;
        transform: none;
        max-width: 100%;
    }

    .header-logo,
    .header-info {
        flex: initial;
    }
}



.main-grid {
    grid-template-columns: 400px 280px minmax(0, 1fr) !important;
    max-width: 100% !important;
    width: 100% !important;
}

.chart-panel {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.chart-panel .panel-content {
    max-width: 100% !important;
    overflow: hidden !important;
}

#seasonal-chart {
    max-width: 100% !important;
    width: 100% !important;
}

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 350px 250px minmax(0, 1fr) !important;
    }
}



@media (max-width: 1100px) {
    .main-grid {
        grid-template-columns: 320px 230px minmax(0, 1fr) !important;
    }

    .controls-panel,
    .stats-panel {
        font-size: 12px;
    }
}




/* ==========================================================================
   SCREENER FINAL FIX - Overflow und Responsive
   ========================================================================== */

/* Verhindere horizontales Scrollen */
body {
    overflow-x: hidden !important;
}

.terminal-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Stelle sicher dass Controls nicht zu breit werden */
.screener-controls {
    max-width: 100%;
}

/* Kritisch: Erlaube der rechten Spalte zu schrumpfen */
.screener-results {
    min-width: 0 !important;
    overflow: hidden;
}

.screener-results .table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
}

/* Für sehr kleine Bildschirme - Panels untereinander */
@media (max-width: 900px) {
    .screener-main-grid {
        grid-template-columns: 1fr !important;
    }
}





/*Srenner entfernung von User Guest und Light Dark Mode Button

/* Header Anpassungen nach Entfernung des Theme-Toggles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--header-color);
}

.header-logo {
    flex: 0 0 auto;
}

.header-info {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Entfernt überflüssige Theme-Button Styles */
.theme-btn {
    display: none !important;
}







/* Scrollbar komplett verstecken für alle Browser */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE und Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari und Opera */
}

body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE und Edge */
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari und Opera */
}









/* ==========================================================================
   SCROLLBAR FIX - NUR FÜR SCREENER SEITE
   ========================================================================== */

/* NUR auf Screener-Seite anwenden */
body.screener-page {
    overflow: hidden !important;
    max-height: 100vh !important;
}

body.screener-page .terminal-container {
    overflow: hidden !important;
    max-height: calc(100vh - 2rem) !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Main Grid NUR auf Screener anpassen */
body.screener-page .screener-main-grid {
    flex: 1;
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 1rem !important;
    max-height: calc(100vh - 92px) !important;
    align-items: stretch !important;
}

/* Panels NUR auf Screener gleich hoch machen */
body.screener-page .screener-main-grid .panel {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Panel Content scrollbar nur wo nötig */
body.screener-page .screener-main-grid .panel-content {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Results Panel Table Container */
body.screener-page .screener-results .table-container {
    height: 100%;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* Scrollbar nur auf Screener-Seite verstecken */
body.screener-page::-webkit-scrollbar {
    display: none !important;
}

body.screener-page {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}





/* ==========================================================================
   SCREENER PANEL BOTTOM SPACING FIX
   ========================================================================== */

/* Terminal Container mit Bottom-Padding */
body.screener-page .terminal-container {
    padding-bottom: 1rem !important; /* Gleicher Abstand wie oben/seitlich */
}

/* Main Grid mit angepasster Höhe */
body.screener-page .screener-main-grid {
    flex: 1;
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 1rem !important;
    max-height: calc(100vh - 108px) !important; /* Erhöht von 92px auf 108px für Bottom-Spacing */
    align-items: stretch !important;
    margin-bottom: 0 !important; /* Sicherstellen, dass kein zusätzlicher Margin */
}

/* Alternative: Wenn Sie mehr Abstand möchten */
body.screener-page main {
    margin-bottom: 1rem !important; /* Fügt Abstand unter dem Main-Grid hinzu */
}






/* ==========================================================================
   HEADER UPDATES - Entfernung von Theme-Toggle und User-Info
   ========================================================================== */

/* Aktualisiertes Header-Layout */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--header-color);
    position: relative;
}

/* Logo bleibt links */
.header-logo {
    flex: 0 0 auto;
}

/* Titel zentriert */
header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    text-align: center;
    flex: 1;
}

/* Action-Button (Screener-Link) rechts */
.header-action {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Theme-Button komplett ausblenden */
.theme-btn {
    display: none !important;
}

/* Header-Info behalten für den Screener-Button */
.header-info {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    header h1 {
        position: static;
        transform: none;
    }

    .header-action {
        width: 100%;
        justify-content: center;
    }
}

/* Navigation Action Button bleibt gleich */
.nav-action-button {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--label-color);
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--label-color);
    border-radius: 3px;
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
    text-align: center;
    font-size: 13px;
}

.nav-action-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
    background-color: var(--header-color);
    border-color: var(--header-color);
}





/* ==========================================================================
   MANAGE BASKETS SCROLLBAR FIX - Wie beim Screener
   ========================================================================== */

/* NUR auf Manage-Baskets-Seite anwenden */
body.manage-baskets-page {
    overflow: hidden !important;
    max-height: 100vh !important;
}

body.manage-baskets-page .terminal-container {
    overflow: hidden !important;
    max-height: calc(100vh - 2rem) !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Main Grid NUR auf Manage Baskets anpassen */
body.manage-baskets-page .screener-main-grid {
    flex: 1;
    display: grid !important;
    grid-template-columns: 400px 1fr !important;
    gap: 1rem !important;
    max-height: calc(100vh - 108px) !important;
    align-items: stretch !important;
    margin-bottom: 0 !important;
}

/* Panels NUR auf Manage Baskets gleich hoch machen */
body.manage-baskets-page .screener-main-grid .panel {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Panel Content scrollbar nur wo nötig */
body.manage-baskets-page .screener-main-grid .panel-content {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Results Panel Table Container */
body.manage-baskets-page .screener-results .table-container {
    height: 100%;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* Scrollbar nur auf Manage-Baskets-Seite verstecken */
body.manage-baskets-page::-webkit-scrollbar {
    display: none !important;
}

body.manage-baskets-page {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Terminal Container mit Bottom-Padding */
body.manage-baskets-page .terminal-container {
    padding-bottom: 1rem !important;
}

/* Responsive Anpassungen */
@media (max-width: 900px) {
    body.manage-baskets-page .screener-main-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Fix für Modal-Scrollbar (Modal darf scrollen) */
body.manage-baskets-page .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Scrollbar in den Panel-Contents behalten (nur Body-Scrollbar entfernen) */
body.manage-baskets-page .panel-content::-webkit-scrollbar,
body.manage-baskets-page .table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.manage-baskets-page .panel-content::-webkit-scrollbar-track,
body.manage-baskets-page .table-container::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

body.manage-baskets-page .panel-content::-webkit-scrollbar-thumb,
body.manage-baskets-page .table-container::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}

body.manage-baskets-page .panel-content::-webkit-scrollbar-thumb:hover,
body.manage-baskets-page .table-container::-webkit-scrollbar-thumb:hover {
    background: var(--label-color);
}



/* ==========================================================================
   INFO-BOX FÜR FEHLENDE KÖRBE
   ========================================================================== */

/* Info-Nachricht wenn keine Körbe vorhanden */
#no-baskets-info {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1) 0%, rgba(255, 201, 60, 0.1) 100%);
    border: 2px solid var(--label-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    animation: pulseGlow 2s ease-in-out infinite;
}

#no-baskets-info strong {
    color: var(--header-color);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 191, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
    }
}

/* Light Mode Anpassungen */
html.light-mode #no-baskets-info {
    background: linear-gradient(135deg, rgba(2, 117, 216, 0.05) 0%, rgba(217, 83, 79, 0.05) 100%);
    border-color: var(--label-color);
}

html.light-mode #no-baskets-info strong {
    color: var(--header-color);
}

/* Deaktiviertes Dropdown visuell hervorheben */
.custom-select-wrapper[style*="pointer-events: none"] .custom-select-trigger {
    background-color: var(--panel-border) !important;
    cursor: not-allowed !important;
}

/* Button "Neuen Korb erstellen" hervorheben wenn keine Körbe vorhanden */
body.manage-baskets-page #show-create-basket-modal-btn:not(:disabled) {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
    }
}

/* Entfernt Animation wenn Körbe vorhanden sind */
body.manage-baskets-page:has(.custom-select-wrapper[style*="pointer-events: auto"]) #show-create-basket-modal-btn {
    animation: none;
}





/* Screener Results Container Fix */
#screener-results-display {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#screener-results-display .table-container {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: auto !important;
    max-height: calc(100vh - 300px) !important;
    min-height: 400px;
}

#basket-content-display .table-container {
    max-height: calc(100vh - 300px) !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    border: 1px solid var(--panel-border);
}

/* Stelle sicher, dass die Panel-Content richtig funktioniert */
body.screener-page .screener-results .panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0.8rem;
}

/* Korrigiere die Tabellen-Anzeige */
#screener-results-table {
    width: 100%;
    display: table !important; /* Wichtig: table, nicht none */
}




<!-- Füge diesen CSS-Code am Ende deiner style.css ein oder in einem <style> Tag in screener.html -->

<style>
/* ==========================================================================
   SCREENER SCROLLING FIX - Erlaubt Scrollen aber behält gleiche Panel-Höhen
   ========================================================================== */

/* ENTFERNT die overflow: hidden Beschränkung vom Body */
body.screener-page {
    overflow: auto !important; /* Erlaubt vertikales Scrollen */
    overflow-x: hidden !important; /* Verhindert horizontales Scrollen */
    max-height: none !important; /* Entfernt Höhenbeschränkung */
}

/* Terminal Container anpassen */
body.screener-page .terminal-container {
    overflow: visible !important; /* Erlaubt Content zu wachsen */
    max-height: none !important; /* Entfernt Höhenbeschränkung */
    min-height: 100vh !important; /* Mindesthöhe = Viewport */
    display: flex !important;
    flex-direction: column !important;
}

/* Main Grid - Panels gleich hoch halten */
body.screener-page .screener-main-grid {
    flex: 1;
    display: grid !important;
    grid-template-columns: 350px 1fr !important;
    gap: 1rem !important;
    min-height: calc(100vh - 120px) !important; /* Mindesthöhe statt max-height */
    align-items: stretch !important; /* WICHTIG: Panels gleich hoch */
}

/* Panels - Beide gleich hoch */
body.screener-page .screener-main-grid .panel {
    height: auto !important; /* Automatische Höhe */
    min-height: calc(100vh - 140px) !important; /* Mindesthöhe für beide Panels */
    display: flex !important;
    flex-direction: column !important;
}

/* Control Panel (links) - Scrollbar nur wenn nötig */
body.screener-page .screener-controls .panel-content {
    flex: 1;
    overflow-y: auto !important; /* Scrollt nur wenn Content zu lang */
    overflow-x: hidden !important;
    max-height: calc(100vh - 180px) !important;
}

/* Results Panel (rechts) - Scrollbar nur wenn nötig */
body.screener-page .screener-results .panel-content {
    flex: 1;
    overflow: hidden !important; /* Container selbst scrollt nicht */
    display: flex;
    flex-direction: column;
    padding: 0.8rem;
}

/* Table Container in Results - Hier findet das Scrollen statt */
body.screener-page .screener-results .table-container {
    flex: 1;
    overflow-y: auto !important; /* Scrollbar für Tabelle */
    overflow-x: auto !important;
    max-height: calc(100vh - 220px) !important;
    min-height: 300px;
}

/* Basket Content Display */
body.screener-page #basket-content-display .table-container {
    max-height: calc(100vh - 220px) !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* Screener Results Display */
body.screener-page #screener-results-display {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Footer/Bottom spacing */
body.screener-page .terminal-container {
    padding-bottom: 1rem !important;
}

/* Scrollbar Styling für bessere Sichtbarkeit */
body.screener-page::-webkit-scrollbar {
    width: 10px !important;
    display: block !important; /* Scrollbar wieder anzeigen */
}

body.screener-page::-webkit-scrollbar-track {
    background: var(--panel-bg) !important;
}

body.screener-page::-webkit-scrollbar-thumb {
    background: var(--panel-border) !important;
    border-radius: 5px !important;
}

body.screener-page::-webkit-scrollbar-thumb:hover {
    background: var(--label-color) !important;
}

/* Firefox Scrollbar */
body.screener-page {
    scrollbar-width: thin !important; /* Zeigt schmale Scrollbar */
    scrollbar-color: var(--panel-border) var(--panel-bg) !important;
}

/* Responsive Anpassungen */
@media (max-width: 1200px) {
    body.screener-page .screener-main-grid {
        grid-template-columns: 300px 1fr !important;
    }
}

@media (max-width: 900px) {
    body.screener-page .screener-main-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Panels untereinander auf kleinen Bildschirmen */
    body.screener-page .screener-main-grid .panel {
        min-height: 400px !important;
    }
}

/* Verhindere dass Panels unterschiedlich lang werden */
body.screener-page .screener-main-grid {
    align-content: start !important; /* Content startet oben */
    grid-auto-rows: 1fr !important; /* Beide Rows gleich hoch */
}

/* Light Mode Anpassungen für Scrollbar */
html.light-mode body.screener-page::-webkit-scrollbar-track {
    background: #f8f9fa !important;
}

html.light-mode body.screener-page::-webkit-scrollbar-thumb {
    background: #dee2e6 !important;
}

html.light-mode body.screener-page::-webkit-scrollbar-thumb:hover {
    background: var(--label-color) !important;
}
</style>





/* ==========================================================================
   SCAN BUTTON FINAL FIX - Ersetze den alten Button-CSS-Code mit diesem
   ========================================================================== */

/* SCAN STARTEN Button - Komplettes Redesign */
#start-scan-button {
    /* Größe und Spacing */
    width: 100% !important;
    min-height: 60px !important;  /* Mindesthöhe für dicken Button */
    padding: 18px 24px !important;  /* Großzügiges Padding */
    margin-bottom: 15px !important;
    margin-top: 0 !important;

    /* Styling */
    background: linear-gradient(135deg, #00bfff 0%, #0099ff 100%) !important;
    color: #ffffff !important;
    border: 2px solid #0099ff !important;
    border-radius: 8px !important;

    /* Text */
    font-size: 18px !important;  /* Größere Schrift */
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    text-align: center !important;

    /* Effects */
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;

    /* Layout */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Button Text */
#start-scan-button .button-text {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    line-height: 1 !important;
}

/* Hover Effect */
#start-scan-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #00aaff 0%, #0088ff 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 191, 255, 0.5) !important;
    border-color: #0088ff !important;
}

/* Active/Click Effect */
#start-scan-button:active:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.4) !important;
}

/* Disabled State */
#start-scan-button:disabled {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%) !important;
    border-color: #3a3a3a !important;
    color: #888888 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Progress Container */
#start-scan-button .progress-container {
    display: none;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    z-index: 1 !important;
}

/* Progress Fill Bar */
#start-scan-button .progress-fill {
    height: 100% !important;
    width: 0 !important;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.1) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0.1) 100%) !important;
    transition: width 0.3s linear !important;
}

/* Loading State */
#start-scan-button.loading {
    background: linear-gradient(135deg, #666666 0%, #555555 100%) !important;
    border-color: #555555 !important;
}

#start-scan-button.loading .progress-container {
    display: block !important;
}

#start-scan-button.loading .button-text {
    color: #ffffff !important;
    z-index: 3 !important;
}

/* Pulse Animation */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(0, 191, 255, 0.6);
    }
}

#start-scan-button:not(:disabled):not(.loading) {
    animation: buttonPulse 2s ease-in-out infinite;
}

/* Light Mode Anpassungen */
html.light-mode #start-scan-button {
    background: linear-gradient(135deg, #0275d8 0%, #025aa5 100%) !important;
    border-color: #025aa5 !important;
    box-shadow: 0 6px 20px rgba(2, 117, 216, 0.4) !important;
}

html.light-mode #start-scan-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #025aa5 0%, #014682 100%) !important;
    border-color: #014682 !important;
    box-shadow: 0 8px 25px rgba(2, 117, 216, 0.5) !important;
}

html.light-mode #start-scan-button:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%) !important;
    border-color: #d0d0d0 !important;
    color: #999999 !important;
}

/* Status und Error Messages direkt unter Button */
#screener-status {
    margin-top: 10px !important;
    margin-bottom: 5px !important;
    font-size: 14px !important;
}

#screener-error-message {
    margin-top: 5px !important;
    margin-bottom: 10px !important;
    font-size: 14px !important;
}

/* Separator nach Button-Bereich */
.screener-controls .separator:first-of-type {
    margin-top: 10px !important;
    margin-bottom: 15px !important;
}

/* Responsive für kleinere Bildschirme */
@media (max-width: 768px) {
    #start-scan-button {
        min-height: 50px !important;
        padding: 15px 20px !important;
        font-size: 16px !important;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    #start-scan-button {
        min-height: 45px !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}

/* ========================================
   CORRELATION ANALYSIS PAGE STYLES
   ======================================== */

.correlation-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.control-panel-correlation {
    margin-bottom: 0;
}

.control-content {
    padding: 1.5rem;
}

.control-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.control-group input[type="text"] {
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Consolas', 'Menlo', monospace;
    text-transform: uppercase;
}

.control-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

.slider-group input[type="range"] {
    width: 100%;
}

.control-button {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    color: var(--button-text);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Menlo', monospace;
    letter-spacing: 0.5px;
}

.control-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-message {
    padding: 1rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.status-message.error {
    color: #ef4444;
    border-color: #ef4444;
}

.status-message.success {
    color: #10b981;
    border-color: #10b981;
}

.status-message.loading {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.metrics-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-card {
    min-height: auto;
}

.metric-card-compact {
    min-height: 0 !important;
    height: auto !important;
    max-height: 200px !important;
}

.metric-card-compact .panel-header {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.85rem !important;
    min-height: 0 !important;
    line-height: 1.1 !important;
    height: auto !important;
}

.metric-card-compact .panel-content {
    padding: 0.25rem 0.5rem !important;
    overflow: visible !important;
    flex-grow: 0 !important;
    flex-shrink: 1 !important;
    min-height: 0 !important;
    height: auto !important;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.metric-content-compact {
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--panel-border);
}

.metric-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 0 !important;
    border-bottom: none !important;
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-item-compact:last-child {
    border-bottom: none;
    padding-bottom: 0 !important;
}

.metric-item.large-metric {
    padding: 1rem 0;
    margin-top: 0.5rem;
}

.metric-item-compact.large-metric {
    padding: 0.2rem 0 !important;
    margin-top: 0.1rem !important;
    padding-top: 0.2rem !important;
    font-size: 0.95rem !important;
}

.metric-item-compact.large-metric .metric-label {
    font-size: 0.9rem !important;
}

.metric-item-compact.large-metric .metric-value {
    font-size: 0.95rem !important;
}

.metric-item-compact .metric-label {
    font-size: 0.85rem !important;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.1 !important;
}

.metric-item-compact .metric-value {
    font-size: 0.9rem !important;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Consolas', 'Menlo', monospace;
    line-height: 1.1 !important;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Consolas', 'Menlo', monospace;
}

.metric-value.very-good {
    color: #10b981;
}

.metric-value.good {
    color: #22c55e;
}

.metric-value.medium {
    color: #f59e0b;
}

.metric-value.bad {
    color: #ef4444;
}

.metric-value.suitable {
    color: #10b981;
    font-size: 1.1rem;
}

.metric-value.conditional {
    color: #f59e0b;
    font-size: 1.1rem;
}

.metric-value.not-suitable {
    color: #ef4444;
    font-size: 1.1rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-panel {
    min-height: 400px;
}

.chart-content {
    padding: 1rem;
    height: 350px;
}

.chart-content canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .control-row {
        grid-template-columns: 1fr;
    }

    .metrics-grid-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid-compact {
        grid-template-columns: 1fr;
    }

    .chart-panel {
        min-height: 300px;
    }

    .chart-content {
        height: 250px;
    }
}


/* ==========================================================================
   HIERARCHISCHES BASKET-SELECT DROPDOWN
   ========================================================================== */

/* Separator vor den Sektor-Kategorien */
.custom-option-separator {
    padding: 0.5rem 1rem;
    text-align: center;
    color: var(--header-color);
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(230, 162, 15, 0.1);
    cursor: default;
    user-select: none;
}

.custom-option-separator:hover {
    background: rgba(230, 162, 15, 0.1);
    color: var(--header-color);
}

/* Option mit Submenu */
.custom-option.has-submenu {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--header-color);
    background: rgba(230, 162, 15, 0.05);
}

.custom-option.has-submenu:hover {
    background-color: var(--header-color);
    color: #fff;
}

.custom-option.has-submenu .submenu-arrow {
    font-size: 0.7em;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

/* Submenu Container */
.custom-submenu {
    position: absolute;
    top: -1px;
    left: calc(100% - 5px);
    min-width: 280px;
    max-width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--panel-bg);
    border: 1px solid var(--header-color);
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    padding: 5px 0;
}

/* Wichtig: Submenü bleibt sichtbar wenn Maus darüber */
.custom-option.has-submenu:hover > .custom-submenu,
.custom-submenu:hover {
    display: block;
    animation: submenuFadeIn 0.15s ease-out forwards;
}

/* Floating Submenü (am body angehängt) */
.floating-submenu {
    position: fixed;
    min-width: 280px;
    max-width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--panel-bg);
    border: 1px solid var(--header-color);
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    display: none;
    padding: 5px 0;
}

.floating-submenu.visible {
    display: block;
    animation: submenuFadeIn 0.15s ease-out forwards;
}

.floating-submenu-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.floating-submenu-item:last-child {
    border-bottom: none;
}

.floating-submenu-item:hover {
    background-color: var(--header-color);
    color: #fff;
}

/* Scrollbar für Floating Submenu */
.floating-submenu::-webkit-scrollbar {
    width: 6px;
}

.floating-submenu::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.floating-submenu::-webkit-scrollbar-thumb {
    background: var(--header-color);
    border-radius: 3px;
}

/* Light Mode */
html.light-mode .floating-submenu {
    background-color: #fff;
    border-color: var(--header-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

html.light-mode .floating-submenu-item {
    color: #333;
    border-color: #eee;
}

html.light-mode .floating-submenu-item:hover {
    background-color: var(--header-color);
    color: #fff;
}

@keyframes submenuFadeIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Submenu nach links öffnen wenn nicht genug Platz */
.custom-submenu.open-left {
    left: auto;
    right: 100%;
}

/* Submenu Items */
.custom-submenu-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-submenu-item:last-child {
    border-bottom: none;
}

.custom-submenu-item:hover {
    background-color: var(--header-color);
    color: #fff;
}

/* Ticker-Anzahl Badge */
.custom-submenu-item .ticker-count {
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 10px;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.custom-submenu-item:hover .ticker-count {
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Scrollbar für Submenu */
.custom-submenu::-webkit-scrollbar {
    width: 6px;
}

.custom-submenu::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.custom-submenu::-webkit-scrollbar-thumb {
    background: var(--header-color);
    border-radius: 3px;
}

/* Light Mode Anpassungen */
html.light-mode .custom-option-separator {
    background: rgba(230, 162, 15, 0.15);
    color: #c48a00;
}

html.light-mode .custom-option.has-submenu {
    background: rgba(230, 162, 15, 0.08);
    color: #c48a00;
}

html.light-mode .custom-submenu {
    background-color: #fff;
    border-color: var(--header-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html.light-mode .custom-submenu-item {
    color: #333;
    border-color: #eee;
}

html.light-mode .custom-submenu-item:hover {
    background-color: var(--header-color);
    color: #fff;
}

html.light-mode .custom-submenu-item .ticker-count {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .custom-submenu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 90vw;
        max-width: 95vw;
        max-height: 70vh;
        z-index: 2000;
    }
    
    .custom-option.has-submenu:hover > .custom-submenu {
        animation: submenuFadeInMobile 0.2s ease-out forwards;
    }
    
    @keyframes submenuFadeInMobile {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
}
