/* ===========================================
   Federpendel Dynamisch - Compact Layout
   Extends: spring_base.css
   =========================================== */

/* Visual area override: fixed height, hidden overflow */
#pendel-bereich {
    height: 480px;
    overflow: hidden;
}

#pendel-controls .exp-timer,
#pendel-controls .exp-oscillation-count {
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}

#pendel-controls .exp-timer-value {
    font-size: 1rem;
}

#pendel-controls .exp-button-group {
    gap: 0.5rem;
}

/* Stabile Breite für Ergebniswerte → kein Umbruch bei Wertänderung */
#ergebnis-zeit,
#ergebnis-periode {
    display: inline-block;
    min-width: 3.5em;
    text-align: right;
}

/* ---- Lineal ---- */
#lineal {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 35px;
    width: 70px;
    /* Ruler palette — intentionally off-brand wood/ivory tones */
    background: linear-gradient(90deg, #fffdf5 0%, #f6ecd2 50%, #fffdf5 100%);
    border: var(--border-thin) solid #d4c9a8;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.lineal-body {
    position: relative;
    width: 100%;
    height: 100%;
}

#lineal-skala {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lineal-tick {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    color: #5a4d3a;   /* ruler ink tone, matches off-brand ruler palette */
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.lineal-tick::before {
    content: '';
    display: block;
    height: 1px;
    border-radius: 1px;
    background: currentColor;
    opacity: 0.6;
    margin-left: 10px;
    margin-right: 6px;
}

.lineal-tick.major::before {
    width: 26px;
    height: 2px;
    opacity: 0.85;
}

.lineal-tick.minor::before {
    width: 16px;
}

.lineal-label {
    margin-left: auto;
    margin-right: 8px;
}

#lineal-marker {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--error-500);
    border-radius: var(--radius-sm);
    /* Literal rgba — no --error-rgb companion token yet (STYLE_GUIDE §6) */
    box-shadow: 0 0 4px rgba(var(--error-rgb), 0.4);
    transform: translateY(-50%);
}

/* ---- Gleichgewichtslage ---- */
#gleichgewicht-marker {
    position: absolute;
    left: 120px;
    right: 130px;
    height: 0;
    /* Indigo accent — no matching brand token; tone chosen to distinguish from error/primary */
    border-top: var(--border-base) dashed rgba(99, 102, 241, 0.5);
    z-index: 4;
    pointer-events: none;
}

.gleichgewicht-label {
    position: absolute;
    right: 0;
    top: -10px;
    transform: translateY(-100%);
    font-size: 0.72rem;
    font-weight: 600;
    /* Matches #gleichgewicht-marker accent */
    color: #6366f1;
    white-space: nowrap;
    background: rgba(248, 250, 252, 0.85);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

/* ---- Auslenkungslabel ---- */
#auslenkung-label {
    position: absolute;
    padding: 0.3rem 0.65rem;
    background: var(--neutrals-0);
    border: var(--border-base) solid var(--error-500);
    border-radius: var(--radius-md);
    color: var(--error-500);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
    transform: translateY(-50%);
    pointer-events: none;
    min-width: 68px;
    text-align: center;
    z-index: 6;
}

/* ---- Halterung ---- */
#halterung {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 30px;
    z-index: 10;
}

.halterung-balken {
    width: 100%;
    height: 100%;
    background: var(--gray-600);
    border-radius: 0 0 5px 5px;
}

/* ---- Feder ---- */
#feder-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(var(--feder-offset, 0px));
    width: 40px;
    height: var(--feder-laenge, 200px);
    will-change: height;
    transition: none;
}

#feder-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* ---- Gewicht ---- */
#gewicht {
    position: absolute;
    top: var(--gewicht-position, 230px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    will-change: top;
    transition: none;
}

.gewicht-koerper {
    width: 72px;
    height: 72px;
    background: var(--gewicht-farbe, var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Shadow bleibt neutral-dark für realistische 3D-Anmutung eines Gewichts */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    position: relative;
}

.gewicht-koerper::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 10px;
    background: var(--gray-600);
    border-radius: 2px;
}

#gewicht-anzeige {
    color: var(--neutrals-0);
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ---- Gewicht-Auswahl rechts ---- */
#gewicht-auswahl-rechts {
    position: absolute;
    top: 50px;
    right: 30px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.gewicht-buttons-vertikal {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1 1 auto;
    width: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.gewicht-buttons-vertikal::-webkit-scrollbar {
    width: 5px;
}

.gewicht-buttons-vertikal::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.15);
    border-radius: 3px;
}

.gewicht-btn {
    min-width: 80px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.gewicht-btn.active {
    background: var(--primary-color);
    color: var(--neutrals-0);
    border-color: var(--primary-color);
}

.gewicht-btn:not(.active) {
    background: var(--slate-100);
    color: var(--slate-600);
    border-color: var(--slate-300);
}

.gewicht-btn:not(.active):hover {
    background: var(--slate-200);
    border-color: var(--slate-400);
}

/* Block 2 ausblenden */
.inputs {
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #pendel-bereich {
        height: 420px;
    }

    #gewicht-auswahl-rechts {
        right: 10px;
        top: 30px;
        gap: 0.3rem;
    }

    .gewicht-btn {
        min-width: 60px;
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .gewicht-koerper {
        width: 56px;
        height: 56px;
    }

    #gewicht-anzeige {
        font-size: 13px;
    }

    #pendel-controls {
        padding: 0.5rem 0.75rem;
    }

    .controls-row {
        gap: 0.5rem;
    }
}
