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

/* Visual area override: extra bottom padding */
#pendel-bereich-static {
    padding-bottom: 2rem;
}

/* ---- Halterung (mount bar) ---- */
#halterung {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 30px;
    z-index: 2;
    transition: width 0.3s ease;
}

#pendel-bereich-static:has(#feder-system.modus-parallel) #halterung {
    width: 250px;
}

/* ---- Spring system ---- */
#feder-system {
    position: absolute;
    left: 50%;
    top: 30px;
    transform: translateX(-50%);
    min-width: 60px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#feder-system.modus-parallel {
    min-width: 150px;
}

#feder-system.modus-reihe {
    min-width: 60px;
}

#federn-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.feder-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feder-svg {
    width: 100%;
    height: var(--feder-height, 120px);
    overflow: visible;
    display: block;
}

/* Einzelfeder */
#feder-system.modus-einzeln #federn-container {
    flex-direction: column;
    align-items: center;
}

#feder-system.modus-einzeln .feder-wrapper {
    width: 60px;
}

/* Parallelschaltung */
#feder-system.modus-parallel #federn-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
}

#feder-system.modus-parallel .feder-wrapper {
    width: 60px;
    flex: 0 0 auto;
}

/* Reihenschaltung */
#feder-system.modus-reihe #federn-container {
    flex-direction: column;
    align-items: center;
}

#feder-system.modus-reihe .feder-wrapper {
    width: 60px;
}

#feder-system.modus-reihe .feder-wrapper[data-feder="2"] {
    margin-top: -10px;
}

/* Verbindungsstueck Reihenschaltung */
#feder-system.modus-reihe .feder-wrapper[data-feder="1"]::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 12px;
    background: var(--gray-600);
    border-radius: 3px;
    z-index: 10;
}

/* Verbindungsstab Parallelschaltung - oben */
#feder-system.modus-parallel::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 8px;
    background: var(--gray-600);
    border-radius: 4px;
    z-index: 4;
}

/* Verbindungsbalken Parallelschaltung - unten */
#feder-system.modus-parallel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(calc(var(--feder-height, 120px) - 120px + 5px));
    width: 160px;
    height: 14px;
    background: var(--gray-700);
    border-radius: 6px;
    z-index: 6;
    border: 1px solid var(--gray-800);
}

/* ---- Gewicht (weight) ---- */
#gewicht {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    top: calc(30px + var(--feder-height, 120px) - 5px);
    transition: top 0.05s linear;
}

#pendel-bereich-static:has(#feder-system.modus-reihe) #gewicht {
    top: calc(30px + var(--feder-height, 120px) * 2 - 25px);
}

.gewicht-haken {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 12px;
    background: var(--gray-600);
    border-radius: 3px 3px 0 0;
}

.gewicht-koerper {
    width: 76px;
    height: 76px;
    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-anzeige {
    color: var(--neutrals-0);
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ---- Lineal (ruler) ---- */
#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: 8px;
    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;
    padding: 10px 0;
}

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

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

.skala-strich.main::before {
    width: 26px;
    height: 2px;
    opacity: 0.85;
}

.skala-strich.minor::before {
    width: 16px;
}

.skala-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%);
}

#lineal-nullpunkt {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transform: translateY(-50%);
    display: none;
    pointer-events: none;
    opacity: 0.7;
}

#lineal-nullpunkt.visible {
    display: block;
}

/* ---- Messwert-Anzeige ---- */
#messwert-anzeige.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: 5;
}

/* ---- Gewicht-Auswahl rechts ---- */
#gewicht-auswahl-rechts {
    position: absolute;
    top: 30px;
    right: 30px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    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: var(--radius-sm);
}

/* Gewicht buttons */
.gewicht-btn {
    width: 100%;
    min-width: 80px;
    padding: 0.4rem 0.8rem;
    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: white;
    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);
}

/* Schaltungs buttons */
.schaltungs-btn {
    min-width: 110px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.schaltungs-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

/* Block 2 (Formular-Eingaben) ausblenden */
.inputs {
    display: none;
}

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

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

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

    #gewicht-auswahl-rechts {
        right: 15px;
    }

    .schaltungs-btn {
        min-width: 90px;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    #feder-system.modus-parallel #federn-container {
        gap: 20px;
    }

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

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