/*
 * Modul:   Wertschätzungs-Index (wertindex)
 * Datei:   wertindex.css
 * Zweck:   Frontend-Styles — Barometer, Pulslinie, Top-Liste, Slider
 * Version: 0.0.2-beta2
 * Datum:   2026-04-18
 * Autor:   Projektteam
 * Abhängig von: wertindex.js, view.php
*/

/* -------------------------------------------------------
   Container
------------------------------------------------------- */
.wertindex-wrap {
    font-family: inherit;
    color: inherit;
    max-width: 520px;
    margin: 1.5rem 0;
}

.wertindex-section {
    margin-bottom: 2rem;
}

/* -------------------------------------------------------
   Modus-Hinweis (nur minimal)
------------------------------------------------------- */
.wertindex-mode-hint {
    font-size: 0.8rem;
    color: #BA7517;
    background: #FAEEDA;
    border-left: 3px solid #EF9F27;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 1rem;
}

/* -------------------------------------------------------
   Barometer
------------------------------------------------------- */
.wertindex-barometer svg {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.wertindex-index-val {
    text-align: center;
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 0.25rem;
}

.wertindex-index-sub {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 0.2rem;
}

/* -------------------------------------------------------
   Pulslinie
------------------------------------------------------- */
.wertindex-pulse {
    display: block;
    width: 100%;
    height: 160px;
}

/* -------------------------------------------------------
   Top-Seiten Liste
------------------------------------------------------- */
.wertindex-top-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wertindex-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.wertindex-top-rank {
    font-size: 0.75rem;
    opacity: 0.5;
    width: 18px;
    text-align: right;
    flex-shrink: 0;
}

.wertindex-top-name {
    font-size: 0.85rem;
    flex: 0 0 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wertindex-top-bar-wrap {
    flex: 1;
    background: rgba(0,0,0,0.07);
    border-radius: 3px;
    height: 6px;
    overflow: hidden;
}

.wertindex-top-bar {
    height: 100%;
    background: #1D9E75;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.wertindex-top-hits {
    font-size: 0.75rem;
    opacity: 0.55;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* -------------------------------------------------------
   Slider-Modus
------------------------------------------------------- */
.wertindex-slider {
    max-width: 100%;
    border-top: 2px solid #1D9E75;
    position: relative;
}

.wertindex-slider-toggle {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #E1F5EE;
    color: #0F6E56;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.wertindex-slider-toggle:hover {
    background: #9FE1CB;
}

.wertindex-slider-inner {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 1rem;
}

/* -------------------------------------------------------
   Dark Mode
------------------------------------------------------- */
@media (prefers-color-scheme: dark) {

    .wertindex-top-row {
        border-bottom-color: rgba(255,255,255,0.08);
    }

    .wertindex-top-bar-wrap {
        background: rgba(255,255,255,0.1);
    }

    .wertindex-mode-hint {
        background: #412402;
        color: #FAC775;
        border-left-color: #EF9F27;
    }

    .wertindex-slider-toggle {
        background: #085041;
        color: #9FE1CB;
    }

    .wertindex-slider-toggle:hover {
        background: #0F6E56;
    }
}
