/* Steuerungs-UI (Handy/Tablet) */

.app-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.app-header h1 span {
    color: var(--primary-light);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.connection-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    position: absolute;
    bottom: -1px;
    right: -1px;
    border: 2px solid #1e2130;
    cursor: default;
}

.connection-dot.connected {
    background: var(--primary-light);
}

/* Filter-Bar mit Radio-Buttons */
.filter-bar {
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    min-width: 90px;
}

.radio-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.radio-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.radio-btn input[type="radio"] {
    display: none;
}

.radio-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

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

.filter-group input[type="search"] {
    flex: 1;
    min-width: 200px;
}

/* ---- Vorschau oben (Tisch + Info nebeneinander) ---- */
.preview-section {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.preview-layout {
    display: flex;
    height: 500px;
}

/* Linke Seite: Tisch exakt 2:1 zur Container-Höhe */
.preview-canvas-wrap {
    flex: 0 0 1000px;   /* 500 × 2 */
    background: #000;
    overflow: hidden;
    position: relative;
}

.preview-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Rechte Seite: Info-Panel füllt den Rest */
.preview-info {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    min-width: 0;
    border-left: 1px solid var(--border);
    overflow: hidden;
}

.preview-info.active-on-projector {
    border-left-color: var(--primary);
    background: rgba(26, 143, 60, 0.05);
}

.preview-info-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 500;
}

.preview-info.active-on-projector .preview-label {
    color: var(--primary-light);
}

.preview-name {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.preview-instructions {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-line;
    overflow-y: auto;
    flex: 1;
}

.preview-info-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-send-projector {
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius);
    white-space: nowrap;
}

.btn-send-projector:hover {
    background: var(--primary-light);
}

.btn-edit-drill {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 14px;
    border-radius: var(--radius);
    white-space: nowrap;
}

.btn-edit-drill:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-clear {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 14px;
    border-radius: var(--radius);
    white-space: nowrap;
}

.btn-clear:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.08);
}

/* Drill-Liste */
.drill-list {
    padding: 12px;
}

/* Kachel-Grid */
.drill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.drill-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    overflow: hidden;
}

.drill-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.drill-tile.active {
    border-color: var(--primary);
    background: rgba(26, 143, 60, 0.1);
}

/* Kachel die in der Vorschau ist (aber noch nicht auf Projektor) */
.drill-tile.previewing {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.drill-tile-preview {
    background: #0a0a0a;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.drill-tile-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.drill-tile-preview--image {
    background: #111;
}

.drill-tile-preview--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drill-tile-body {
    padding: 10px 12px;
}

.drill-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.drill-tile-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.drill-tile-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.drill-tile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-anfaenger { background: #1e3a5f; color: #60a5fa; }
.badge-fortgeschritten { background: #3b3117; color: #fbbf24; }
.badge-profi { background: #3b1717; color: #f87171; }

.drill-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.drill-card-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--bg-hover);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
}

.drill-card-btn:hover {
    color: var(--text);
}

.drill-card-edit:hover {
    background: var(--info);
    color: white;
}

.drill-card-delete:hover {
    background: var(--danger);
    color: white;
}

.drill-card-play {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-left: auto; /* ganz rechts */
}

.drill-card-play:hover {
    background: var(--primary-light);
}

/* Toggle Label – sieht aus wie ein Button */
.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: all 0.15s;
    user-select: none;
}

.toggle-label:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Wenn die Checkbox gecheckt ist → aktiver Zustand */
.toggle-label:has(input:checked) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.toggle-label input[type="checkbox"] {
    display: none; /* Checkbox verstecken, Label-Style übernimmt */
}

/* Preview Settings (ehemals untere Leiste, jetzt im Info-Panel) */
.preview-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.settings-item {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-item select {
    font-size: 12px;
    padding: 4px 8px;
}

.btn-editor {
    background: var(--warning, #f59e0b);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius);
}

.btn-projector {
    background: var(--info);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius);
}

.btn-help {
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius);
}
.btn-help:hover {
    color: var(--text);
    background: var(--border);
}

/* Kein Body-Padding mehr nötig (Settings-Bar wurde entfernt) */

/* Leer-Zustand */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    box-shadow: var(--shadow);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}
