/* ============================================================
   EXERCISE LAYOUT
============================================================ */

.exercise-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 900px) minmax(220px, 280px);
    gap: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    align-items: start;
    justify-content: center;
}

.exercise-layout > * {
    min-width: 0;
}

#exerciseList {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 22px;
}

/* ============================================================
   BUCHUNGSZEILEN
============================================================ */

.booking-row {
    display: grid;
    grid-template-columns: 1fr 1fr 140px;
    gap: 20px;
}

.booking-row-clean {
    align-items: end;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.booking-row .cell > div:first-child {
    font-weight: 600;
    font-size: 14px;
}

.booking-cell {
    display: grid;
    gap: 8px;
}

.booking-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.booking-amount-cell {
    justify-items: end;
}

/* ============================================================
   DROPZONES
============================================================ */

.dropzone {
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    word-break: break-word;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.dropzone .drop-item {
    width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    text-align: center;
}

.dropzone.over {
    background: #e0e7ff;
    border-color: #6366f1;
    transform: translateY(-1px);
}

/* Mini-Box innerhalb der Dropzone */
.drop-item,
.mini-class-box {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    cursor: grab;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   AMOUNT INPUT
============================================================ */

.amountInput {
    width: 132px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-align: right;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.amountInput::placeholder {
    color: #94a3b8;
}

/* ============================================================
   SIDEBAR
============================================================ */

.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    align-self: flex-start;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sidebar[style*="position: fixed"] {
    padding-right: 10px;
}

.sidebar h3 {
    margin-bottom: 10px;
}

/* ============================================================
   KONTOKLASSEN
============================================================ */

.class-box {
    padding: 10px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: grab;
    margin-bottom: 8px;
    user-select: none;
}

/* Klassen Farben */
.class-0 { background: #6b7280; }
.class-1 { background: #0ea5e9; }
.class-2 { background: #16a34a; }
.class-3 { background: #f97316; }
.class-4 { background: #a855f7; }
.class-5 { background: #475569; }
.class-6 { background: #0f766e; }
.class-7 { background: #dc2626; }
.class-8 { background: #44403c; }
.class-9 { background: #7c3aed; }

/* ============================================================
   SIDEBAR UNTERKONTEN – AKKORDEON
============================================================ */

.sidebar-class-header {
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    margin-bottom: 6px;
}

.sidebar-class-header::after {
    content: "⯆";
    float: right;
}

.sidebar-class-header.open::after {
    content: "⯅";
}

/* Unterkonten-Gruppe */
.sidebar-subgroup {
    display: none;
    padding-left: 12px;
}

.sidebar-subgroup.open {
    display: block;
}

.subaccount {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
    cursor: grab;
    font-size: 14px;
    color: var(--gray-700);
}

.subaccount:hover {
    background: #e0e7ff;
    border-color: #6366f1;
}

.dropzone.ok {
    border-color: #22c55e;
    background: #ecfdf5;
}

.amountInput.ok {
    border-color: #22c55e;
    background: #ecfdf5;
}

.result.success {
    color: #16a34a;
}

.result.error {
    color: #dc2626;
}


.result ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.result li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.exercise-card-head {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.exercise-card-head-compact {
    margin-bottom: 16px;
}

.exercise-card-head-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.exercise-card-head h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
    color: #0f172a;
}

.exercise-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.exercise-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.exercise-status-pill-mastered {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.exercise-entry-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.exercise-card-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
}

.exercise-result {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    min-height: 56px;
}


/* Calculator als vollwertige Übungskarte */
.calc-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

/* Titel wie bei Übungen */
.calc-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}


    .calc-frame {
        width: 100%;
        height: 360px;
        border: none;
        display: block;
        border-radius: 12px;
}


/* Infofenster */
.info-card {
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    text-align: center;
}


/* Kopfzeile */
.info-toggle {
    all: unset;
    cursor: pointer;
    width: 100%;
    padding: 20px 24px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    font-size: 22px;
    font-weight: 700;
}

/* Chevron */
.info-toggle .chevron {
    font-size: 16px;
    transition: transform 0.25s ease;
}

/* Body (Inhalt) */
#infoBody {
    padding: 0 24px 24px 24px;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.2s ease;
}

/* Eingeklappt */
.info-card.collapsed #infoBody {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Chevron drehen */
.info-card.collapsed .chevron {
    transform: rotate(-90deg);
}


.info-card h2 {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
}

.info-card p {
    max-width: 720px;
    margin: 0 auto 16px auto;
    line-height: 1.6;
    color: #333;
}

/* ============================================================
   INFOFENSTER – Text links / GIF rechts
============================================================ */

.info-flex {
    display: flex;
    gap: 32px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.info-text {
    max-width: 520px;
    text-align: left;
}

.info-text p {
    margin-bottom: 12px;
    line-height: 1.6;
}


.info-gif {
    display: flex;
    flex-direction: column;
    align-items: center; /* ✅ zentriert GIF UND Button */
    gap: 16px;
}


/* WICHTIG: Das Demo-GIF braucht eine Referenzfläche */
#gif-tax,
#gif-multiline,
#demo-gif {
    position: relative;        /* ✅ DAS IST DER FIX */
    width: 280px;
    height: 190px;
    margin: 0 auto;
}





.info-btn {
    width: 260px;
    padding: 10px 18px;
    font-size: 14px;
    text-decoration: none;
    background: #1d4ed8;
    color: #fff;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin-top: 50px;
}


.info-btn:hover {
    background: #2563eb;
}

@media (max-width: 520px) {
    .exercise-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
}

@media (max-width: 1100px) {
    .booking-row-clean {
        grid-template-columns: 1fr;
    }

    .booking-amount-cell {
        justify-items: stretch;
    }

    .amountInput {
        width: 100%;
        text-align: left;
    }

    .exercise-card-head h3 {
        font-size: 21px;
    }
}



