:root {
    --pendulum-primary: #0d6efd;
}

/* Hauptcontainer */
#physikalisches-pendel-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(145deg, #ffffff 0%, #e8f0fe 50%, #d6e4f7 100%);
    border-radius: 16px;
    min-height: 640px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Pendelbereich - kompakt */
#pendel-bereich {
    position: relative;
    width: 100%;
    min-height: 480px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: visible;
    padding-bottom: 2rem;
}

/* Aufhängepunkt-Auswahl rechts */
#aufhaengepunkt-rechts {
    position: absolute;
    top: 30px;
    right: 30px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

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

.aufhaengepunkt-buttons-vertikal::-webkit-scrollbar {
    width: 6px;
}

.aufhaengepunkt-buttons-vertikal::-webkit-scrollbar-thumb {
    background: rgba(14, 65, 148, 0.35);
    border-radius: 3px;
}

.aufhaengepunkt-buttons-vertikal .suspension-btn {
    width: 100%;
    min-width: 70px;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
}

/* SVG Container */
.pendulum-visual {
    width: 100%;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pendulum-svg {
    width: 100%;
    height: 100%;
    max-width: 500px;
}

#pendulum-group {
    transform-origin: 0 0;
}

#pivot-arm {
    stroke: #3d434c;
}

#pivot-to-com {
    transition: opacity 0.3s ease;
}

#pendulum-disc path {
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.suspension-point {
    fill: #ffffff;
    stroke: #566173;
    stroke-width: 2;
    cursor: pointer;
    transition: transform 0.2s ease, fill 0.3s ease, stroke 0.3s ease;
}

.suspension-point:hover {
    transform: scale(1.15);
    fill: rgba(13, 110, 253, 0.12);
    stroke: var(--pendulum-primary);
}

.suspension-point.active {
    fill: #0d6efd;
    stroke: #0d6efd;
    transform: scale(1.25);
}

/* Button Styles für kompakte Darstellung */
.suspension-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.suspension-btn.active {
    background: linear-gradient(135deg, #0e4194 0%, #1e5bb8 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(14, 65, 148, 0.3);
    border-color: #0e4194;
}

.suspension-btn:not(.active):hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    transform: scale(1.02);
}

#center-of-mass {
    fill: #ff4d4f;
    stroke: #ffffff;
    stroke-width: 2;
}

#center-of-mass-label {
    fill: #ff4d4f;
    font-size: 18px;
    font-weight: 600;
}

#angle-indicator text {
    font-weight: 600;
}

/* Kompakte Steuerung unten */
#pendel-steuerung {
    width: 100%;
}

#pendel-steuerung .justify-content-startandend {
    justify-content: space-between;
}

#pendel-steuerung .gap-middle {
    gap: 1rem;
}

#pendel-steuerung .button-gruppe button {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.3s ease;
}

#pendel-steuerung .button-gruppe button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#pendel-steuerung .button-gruppe button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#ergebnis-kompakt {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

#ergebnis-kompakt span {
    white-space: nowrap;
}

.stopuhr-anzeige-kompakt {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.stopuhr-anzeige-kompakt #stopuhr-zeit {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.schwingungszaehler-kompakt {
    padding: 0.5rem 1rem;
    background: #e9ecef;
    border-radius: 4px;
}

/* Alte Steuerungsbereiche - falls noch genutzt */
#steuerung {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

#steuerung-fortsetzung {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Steuerungsgruppen */
.steuerung-gruppe {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Ergebnisse-Gruppe nimmt volle Breite */
#steuerung-fortsetzung .steuerung-gruppe:last-child {
    grid-column: 1 / -1;
}

/* Ergebnisse Box */
.ergebnisse-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.ergebnis-zeile {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.ergebnis-zeile:last-child {
    border-bottom: none;
}

/* Stopuhr */
.stopuhr-bereich {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stopuhr-anzeige {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: inline-block;
    min-width: 200px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.schwingungszaehler {
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* Slider anpassen */
.custom-inputslider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: lightgrey;
    outline: none;
    transition: background 0.3s;
}

.custom-inputslider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0e4194;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.custom-inputslider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0e4194;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Buttons */
.button-gruppe {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn svg {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Utility Classes */
.text-h2 {
    font-size: 2rem;
}

.text-h3 {
    font-size: 1.5rem;
}

.primarycolor {
    color: #0e4194;
}

.robotobold {
    font-weight: 700;
}

.gap-large {
    gap: 1.5rem;
}

.gap-middle {
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    #physikalisches-pendel-container {
        padding: 1rem;
    }

    #pendel-bereich {
        min-height: 420px;
    }

    .pendulum-visual {
        height: 380px;
    }

    #aufhaengepunkt-rechts {
        right: 15px;
    }

    #pendel-steuerung {
        font-size: 0.9rem;
    }

    #pendel-steuerung .display-flex {
        flex-wrap: wrap;
    }

    #ergebnis-kompakt {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    #ergebnis-kompakt button {
        width: 100%;
        justify-content: center;
    }

    .stopuhr-anzeige-kompakt,
    .schwingungszaehler-kompakt {
        width: 100%;
        text-align: center;
    }

    #steuerung {
        grid-template-columns: 1fr;
    }

    .steuerung-gruppe {
        padding: 1rem;
    }

    input[type="range"] {
        width: 100% !important;
    }
}
