/* ============================================
   VORFÜHRMODUS – MOBILE ANSICHT
   ============================================ */

/* --- WICHTIG: hidden-Attribut erzwingen ---
   Die Klassen unten setzen display:flex, was das
   HTML-hidden-Attribut überschreiben würde.
   Diese Regel stellt sicher, dass [hidden] immer gewinnt. */

[hidden] {
    display: none !important;
}

/* --- Basis --- */

body {
    background: var(--bg-light);
}

button {
    font-family: inherit;
}

/* --- PLAN-AUSWAHL --- */

.plan-selection {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.selection-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 35px 25px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.selection-card h1 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-size: 26px;
    line-height: 1.3;
}

.selection-hint {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.selection-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.selection-select {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    background: white;
}

.btn-start {
    width: 100%;
    padding: 15px;
    font-size: 17px;
    font-weight: 700;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.btn-start:hover {
    opacity: 0.9;
}

/* --- VORFÜHR-STAGE --- */

.view-stage {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: #0f172a;
    color: #ffffff;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: #1e293b;
    flex-shrink: 0;
}

.view-header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.view-plan-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-progress {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.btn-exit,
.btn-wake {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-exit:hover,
.btn-wake:hover {
    background: rgba(255,255,255,0.22);
}

.btn-wake.active {
    background: #fbbf24;
    color: #1e293b;
}

/* --- FOLIEN-BEREICH --- */

.view-card-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

/* --- FOLIE 0: ÜBERSICHTSSEITE --- */

.view-overview {
    background: #1e293b;
    border-radius: 16px;
    padding: 28px 20px;
    max-width: 700px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.overview-header {
    text-align: center;
}

.overview-title {
    margin: 0 0 10px 0;
    font-size: 30px;
    line-height: 1.2;
    color: #ffffff;
    font-weight: 700;
}

.overview-plan-name {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 600;
    color: #e2e8f0;
}

.overview-total-time {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
}

.overview-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.overview-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.overview-box {
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 18px 20px;
    flex: 1;
}

.overview-box-title {
    margin: 0 0 14px 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    text-decoration: underline;
}

.overview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.overview-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dotted #475569;
    font-size: 17px;
    color: #e2e8f0;
}

.overview-item:last-child {
    border-bottom: none;
}

.overview-item .overview-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.overview-item .overview-item-duration {
    font-weight: 700;
    white-space: nowrap;
    color: #cbd5e1;
}

.overview-total-row {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 2px solid #334155;
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
}

/* --- FOLIE 1..n: ÜBUNGS-KARTE --- */

.view-exercise {
    background: #1e293b;
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 700px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Name + Zeit in einer Zeile, Platz sparend */
.view-ex-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.view-ex-name {
    margin: 0;
    font-size: 26px;
    line-height: 1.25;
    color: #ffffff;
    min-width: 0;
    overflow-wrap: break-word;
}

.view-ex-duration {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
    flex-shrink: 0;
}

.view-ex-materials,
.view-ex-description,
.view-ex-notes {
    background: #0f172a;
    border-radius: 12px;
    padding: 14px 16px;
}

.view-ex-materials strong,
.view-ex-description strong,
.view-ex-notes strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.view-ex-materials p,
.view-ex-description p,
.view-ex-notes p {
    margin: 0;
    font-size: 17px;
    line-height: 1.65;
    color: #e2e8f0;
    white-space: pre-wrap;
}

.view-ex-notes p {
    font-style: italic;
    color: #cbd5e1;
}

.view-ex-board {
    border-radius: 12px;
    background: #0f172a;
    padding: 10px;
    text-align: center;
}

.view-ex-board img {
    max-width: 100%;
    max-height: 45vh;
    border-radius: 8px;
    border: 1px solid #334155;
}

/* --- FUSSZEILE / NAVIGATION --- */

.view-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #1e293b;
    flex-shrink: 0;
}

.btn-nav {
    padding: 16px 22px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    min-width: 110px;
}

.btn-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.view-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.view-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #475569;
}

.view-dot.current {
    background: #fbbf24;
}

.view-dot.overview-dot {
    width: 18px;
    border-radius: 5px;
}

/* --- RESPONSIVE: TABLET / DESKTOP --- */

@media screen and (min-width: 768px) {
    .view-overview,
    .view-exercise {
        padding: 32px;
    }

    .overview-title {
        font-size: 38px;
    }

    .overview-plan-name {
        font-size: 24px;
    }

    .overview-logo {
        height: 100px;
    }

    .overview-item {
        font-size: 20px;
    }

    .view-ex-name {
        font-size: 34px;
    }

    .view-ex-description p,
    .view-ex-materials p {
        font-size: 20px;
    }

    .btn-nav {
        padding: 18px 30px;
        font-size: 18px;
    }
}