/* src/css/quiz.css */

/* =========================================
   1. DAS VERBORGENE QUIZ-MODAL (Die Hülle)
   ========================================= */
.quiz-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 17, 32, 0.85); /* TSC Nachtblau mit 85% Transparenz */
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 2000; /* 🔴 Muss über der Navigation liegen! */
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}

.quiz-modal-overlay.active {
    opacity: 1; pointer-events: auto;
}

.quiz-modal-content {
    background: var(--color-bg-card); /* Unser edles Frostglas */
    width: 90%; max-width: 800px; max-height: 90vh;
    border-radius: 28px; padding: 50px; position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    overflow-y: auto;
    
    /* Die Einflug-Animation des Kastens */
    transform: translateY(40px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-modal-overlay.active .quiz-modal-content {
    transform: translateY(0) scale(1);
}

.quiz-close-btn {
    position: absolute; top: 25px; right: 30px;
    background: none; border: none; font-size: 2.5rem; color: var(--color-text-muted);
    cursor: pointer; transition: 0.3s; line-height: 1;
}
.quiz-close-btn:hover { color: var(--color-brand-primary); transform: scale(1.1) rotate(90deg); }


/* =========================================
   2. QUIZ UI-ELEMENTE (Buttons, Balken, Texte)
   ========================================= */
.quiz-progress-bar {
    width: 100%; height: 6px; background: var(--border-card);
    border-radius: 3px; margin-bottom: 30px; overflow: hidden;
}
.quiz-progress-fill {
    height: 100%; background: var(--color-brand-primary);
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-step { transition: opacity 0.4s ease, transform 0.4s ease; }
.quiz-step.fade-out { opacity: 0; transform: translateX(-20px); }

.quiz-question {
    font-family: var(--font-heading); font-size: 1.8rem; color: var(--color-text-main);
    margin-bottom: 25px; text-align: center; font-weight: 800; letter-spacing: -0.5px;
}

.quiz-input {
    width: 100%; padding: 18px 20px; border-radius: 16px;
    border: 2px solid var(--border-card); background: var(--color-bg-island);
    font-family: var(--font-body); font-size: 1.05rem; color: var(--color-text-main);
    box-sizing: border-box; transition: 0.3s; resize: vertical;
}
.quiz-input:focus { 
    border-color: var(--color-brand-primary); outline: none; 
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand-primary) 15%, transparent); 
}

.quiz-submit-btn {
    background: var(--color-brand-primary); color: white; border: none;
    padding: 18px 30px; font-size: 1.15rem; font-weight: 700; border-radius: 16px;
    cursor: pointer; transition: 0.3s; width: 100%; margin-top: 10px;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--color-brand-primary) 25%, transparent);
}
.quiz-submit-btn:hover { 
    background: var(--color-brand-hover); transform: translateY(-2px); 
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-brand-primary) 35%, transparent); 
}

.quiz-form-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.quiz-form-group label { font-size: 0.95rem; font-weight: 700; color: var(--color-text-muted); }

.quiz-success { text-align: center; padding: 40px 20px; }


/* =========================================
   3. MULTI-SELECT KACHELN
   ========================================= */
.quiz-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* 🔴 MAGIE: Pures CSS! Wenn exakt 4 Antworten existieren, erzwinge ein 2x2 Quadrat! */
.quiz-checkbox-grid:has(> :last-child:nth-child(4)) {
    grid-template-columns: repeat(2, 1fr);
}

/* Auf mobilen Geräten lösen wir das Quadrat auf, damit die Kacheln nicht zu schmal werden */
@media (max-width: 600px) {
    .quiz-checkbox-grid:has(> :last-child:nth-child(4)) {
        grid-template-columns: 1fr;
    }
}

.quiz-checkbox-label {
    background: var(--color-bg-island);
    border: 2px solid var(--border-card);
    border-radius: 16px;
    padding: 25px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quiz-checkbox-label:hover {
    border-color: var(--color-brand-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.quiz-checkbox-label input[type="checkbox"] { display: none; }

.quiz-checkbox-label .quiz-icon {
    width: 48px; height: 48px; color: var(--color-brand-primary);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; justify-content: center; align-items: center;
}
.quiz-checkbox-label .quiz-icon svg { width: 100%; height: 100%; fill: currentColor; }

/* 🔴 NEU: Sehr seriöser, sanfter Hover (Ohne kindliche Rotation) */
.quiz-checkbox-label input[type="checkbox"]:checked + .quiz-icon { 
    transform: scale(1.1) translateY(-2px); 
}

.quiz-checkbox-label:has(input[type="checkbox"]:checked) {
    background: color-mix(in srgb, var(--color-brand-primary) 8%, white);
    border-color: var(--color-brand-primary);
    box-shadow: inset 0 0 0 1px var(--color-brand-primary), var(--shadow-hover);
}

.quiz-checkbox-text { font-size: 1.05rem; font-weight: 700; color: var(--color-text-main); line-height: 1.4; }

/* Kleiner Haken oben rechts, wenn ausgewählt */
.quiz-checkbox-check {
    position: absolute; top: 15px; right: 15px;
    width: 20px; height: 20px; background: var(--color-brand-primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: scale(0); transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-checkbox-check svg { width: 12px; height: 12px; stroke-width: 3; stroke: white; fill: none; }
.quiz-checkbox-label:has(input[type="checkbox"]:checked) .quiz-checkbox-check { opacity: 1; transform: scale(1); }


/* =========================================
   4. DRAG & DROP UPLOAD ZONE
   ========================================= */
.quiz-drag-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
    background: var(--color-bg-island);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.quiz-drag-drop-zone:hover, .quiz-drag-drop-zone.dragover {
    border-color: var(--color-brand-primary);
    background: color-mix(in srgb, var(--color-brand-primary) 5%, white);
}
.quiz-drag-drop-zone svg { width: 48px; height: 48px; color: var(--color-brand-primary); margin-bottom: 15px; opacity: 0.8; }
.quiz-drag-drop-zone p { margin: 0; }
.quiz-drag-drop-zone .main-text { font-size: 1.1rem; font-weight: 700; color: var(--color-text-main); margin-bottom: 5px; }
.quiz-drag-drop-zone .sub-text { font-size: 0.9rem; color: var(--color-text-muted); }

.quiz-file-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-file-item {
    background: white; border: 1px solid var(--border-card); border-radius: 8px;
    padding: 10px 15px; display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9rem; color: var(--color-text-main); font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.quiz-file-item .remove-file { color: #ef4444; cursor: pointer; border: none; background: none; font-size: 1.2rem; line-height: 1; margin-left: 15px; }