/* =========================================
   1. ZMIENNE I KONFIGURACJA (ROOT)
   ========================================= */
:root {
    /* Paleta kolorów - Dark Mode */
    --bg-app: #0f172a;          /* Tło aplikacji */
    --bg-panel: #1e293b;        /* Tło paneli/kart */
    --bg-item: #334155;         /* Tło elementów interaktywnych */
    --bg-item-hover: #475569;   /* Hover elementów */

    --text-main: #f1f5f9;       /* Główny tekst */
    --text-muted: #94a3b8;      /* Tekst pomocniczy */

    --accent: #3b82f6;          /* Kolor akcentu (niebieski) */
    --accent-hover: #2563eb;
    --danger: #ef4444;          /* Kolor ostrzegawczy/usuwania */
    --danger-hover: #dc2626;
    --success-bg: #064e3b;      /* Tło poprawnej odpowiedzi */
    --success-border: #34d399;
    --error-bg: #450a0a;        /* Tło błędnej odpowiedzi */
    --error-border: #f87171;

    --border: #334155;          /* Ramki */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --radius: 12px;             /* Zaokrąglenia */
    --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* INTEGRACJA: Wysokość navbara (szacunkowa) */
    --navbar-height: 56px;
}

/* =========================================
   2. RESET I STYLE GLOBALNE
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-stack);
    font-size: 14px;
    line-height: 1.5;

    /* ZMIANA: Usuwamy 'height: 100vh' i 'overflow: hidden' */
    /* Dzięki temu strona będzie się naturalnie przewijać razem z navbarem */
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Upewniamy się, że Navbar jest zawsze na wierzchu */
.navbar {
    position: relative;
    z-index: 1000;
}

/* Paski przewijania */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-item);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Elementy formularzy i przyciski */
button {
    background: var(--bg-item);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover:not(:disabled) {
    background: var(--bg-item-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

input[type="text"], select {
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    font-size: 0.85rem;
}
input[type="text"]:focus, select:focus {
    border-color: var(--accent);
}

/* =========================================
   3. WIDOK BUILDERA (Edytor Quizu)
   ========================================= */
#builder-view {
    position: fixed;
    /* INTEGRACJA: Zaczynamy pod navbarem */
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 10;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
}

#container {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 16px;
    padding: 16px;
    padding-bottom: 80px; /* Miejsce na footer buildera */
    min-height: 0;
}

.panel {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    height: 100%;
    min-height: 100%;
}

#available-questions,
#quiz-structure {
    flex: 1;              /* Zajmuje całą dostępną przestrzeń pod wyszukiwarką */
    overflow-y: auto;     /* Włącza przewijanie tylko dla tego obszaru */
    min-height: 0;        /* Ważne dla poprawnego działania w Flexbox (np. Firefox) */
    padding-right: 6px;   /* Lekki odstęp dla paska przewijania */
}

#left-panel { width: 50%; }
#right-panel { width: 50%; }

/* Nagłówki w panelach */
h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

/* Pasek wyszukiwania */
.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 8px;
}
.search-bar input[type="text"] { flex: 1; min-width: 150px; }
.search-bar label { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.search-count { font-size: 0.8rem; color: var(--accent); margin-left: auto; font-weight: bold; }
mark.search-hit { background: rgba(234, 179, 8, 0.3); color: #fef08a; padding: 0 2px; border-radius: 2px; }
mark.search-hit.current-hit { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* Drzewo folderów i pytań */
.left-folder-header, .left-question,
.right-folder-header, .right-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.1s;
}

.left-folder-header:hover, .left-question:hover,
.right-folder-header:hover, .right-question:hover {
    background: var(--bg-item);
}

.folder-name, .left-folder-header span:first-child { font-weight: 600; color: var(--accent); }
.left-folder-header span:first-child::before, .folder-name::before { margin-right: 6px; filter: grayscale(1); }
.left-question span:first-child::before, .right-label::before { content: "📄"; margin-right: 6px; opacity: 0.6; }

/* Wcięcia dla dzieci */
.left-folder > div, .right-folder-children {
    border-left: 1px solid rgba(255,255,255,0.05);
    margin-left: 12px !important;
    padding-left: 8px;
}

/* Akcje i przyciski w drzewie */
.actions button { padding: 2px 8px; font-size: 0.75rem; margin-left: 4px; }
button.add-left { background: var(--accent); color: white; border: none; }
button.add-left:hover { background: var(--accent-hover); }
button.remove-right { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
button.remove-right:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Drag & Drop */
.dragging { opacity: 0.4; background: var(--bg-item); border: 1px dashed var(--accent); }
.drop-placeholder { height: 4px !important; margin: 4px 0 !important; background: var(--accent) !important; border-radius: 2px; box-shadow: 0 0 8px var(--accent); }
.right-folder-children[data-empty-drop="true"] { min-height: 40px; background: rgba(255,255,255,0.02); border-radius: 4px; }
.empty-hint { font-size: 0.8rem; color: var(--text-muted); font-style: italic; text-align: center; padding: 8px; pointer-events: none; }

/* Footer Buildera */
#quiz-footer {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 70px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 20;
}
#start-quiz { background: var(--accent); color: white; font-size: 1rem; padding: 10px 30px; border-radius: 30px; border: none; font-weight: bold; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }
#start-quiz:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59, 130, 246, 0.5); }

/* =========================================
   4. WIDOK QUIZU (PYTANIE) - POPRAWIONE
   ========================================= */
#question-view {
    /* ZMIANA: 'relative' zamiast 'fixed'. To sprawia, że jest częścią strony */
    position: relative;
    z-index: 10;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    /* Marginesy i paddingi */
    width: 100%;
    min-height: 100vh; /* Rozciągnij na min. wysokość ekranu */
    padding-top: 20px;

    /* KLUCZOWE: Ogromny padding na dole, żeby treść nigdy nie była schowana za Music Control */
    padding-bottom: 150px;
}

#question-header, #question-controls, #question-feedback, #question-main {
    width: 100%;
    max-width: 800px;
}

#question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 10px;
}
#question-title { margin: 0; font-size: 1.5rem; color: var(--accent); }
#question-timer { font-family: monospace; font-size: 1.2rem; background: rgba(0,0,0,0.3); padding: 4px 10px; border-radius: 4px; }

#question-main {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);

    width: 100%;
    max-width: 800px;

    /* ZMIANA: Usuwamy ograniczenie wysokości i wewnętrzny scroll */
    /* To naprawia problem nakładania się odpowiedzi na media */
    max-height: none;
    overflow: visible;
    height: auto;
    margin-bottom: 40px; /* Margines na dole dla estetyki przy scrollowaniu */
}

#question-body {
    display: flex;
    flex-direction: column;
}

#question-text {
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Kontener odpowiedzi */
#answers-container { display: flex; flex-direction: column; gap: 8px; }

.quiz-answer-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-item);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}
.quiz-answer-item:hover { background: var(--bg-item-hover); }
.quiz-answer-item input { transform: scale(1.2); cursor: pointer; }
.quiz-answer-item label { cursor: pointer; flex: 1; font-size: 1rem; }

.quiz-answer-item.correct-answer { background: rgba(6, 78, 59, 0.4); border-color: var(--success-border); }
.quiz-answer-item.wrong-answer { background: rgba(69, 10, 10, 0.4); border-color: var(--error-border); }

/* MEDIA (POD PYTANIEM) */
#question-media {
    width: 100%;
    height: 360px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
}

#media-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 10px;
    position: relative;
}

#media-view[style*="display: none"] { display: none !important; }

#media-image, #media-video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

#media-audio {
    width: 80%;
    margin: auto;
}

#media-controls {
    margin-top: auto;
    padding-bottom: 4px;
    display: flex;
    gap: 10px;
}
#media-controls button { font-size: 0.8rem; padding: 4px 10px; }

/* Dolne sterowanie */
#question-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 16px;
}
#submit-answer, #next-question {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    border: none;
}
#submit-answer { background: var(--accent); color: white; }
#submit-answer:hover { background: var(--accent-hover); }
#next-question { background: var(--success-bg); border: 1px solid var(--success-border); color: #ecfdf5; }
#next-question:hover { background: var(--success-border); color: #064e3b; }

#question-feedback {
    background: var(--bg-panel);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    margin-top: 16px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

/* WIZUALNE WSKAŹNIKI ODPOWIEDZI */
.feedback-status {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.feedback-status.success { color: var(--success-border); text-shadow: 0 0 10px rgba(52, 211, 153, 0.3); }
.feedback-status.error { color: var(--error-border); text-shadow: 0 0 10px rgba(248, 113, 113, 0.3); }
.feedback-status.typo { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.35); }

/* Blok informacji o literówce */
.feedback-typo {
    background: rgba(120, 80, 0, 0.25);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-left: 4px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0 4px;
    font-size: 0.95rem;
    color: var(--text-main);
    text-align: left;
    line-height: 1.75;
}


/* =========================================
   5. WIDOK PODSUMOWANIA (SUMMARY)
   ========================================= */
#summary-view {
    position: fixed;
    /* INTEGRACJA: Poniżej navbara */
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--bg-app);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px;
}
#summary-stats {
    background: var(--bg-panel); padding: 30px; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border);
    max-width: 600px; width: 100%; margin-bottom: 20px;
}
#summary-stats p { font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding: 8px 0; display: flex; justify-content: space-between; }
#summary-stats p span { font-weight: bold; color: var(--accent); }
#summary-breakdown { display: none; }

/* =========================================
   6. ODTWARZACZ MUZYKI (WIDGET)
   ========================================= */
#music-control {
    /* ZMIANA: Stała pozycja w prawym górnym rogu */
    position: fixed;
    top: calc(var(--navbar-height) + 16px);
    right: 16px;
    bottom: auto; /* Resetujemy 'bottom' z poprzedniej wersji */
    z-index: 9999;

    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
#music-toggle {
    background: transparent; border: none; font-size: 1.2rem; padding: 4px;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
#music-toggle:hover { background: rgba(255,255,255,0.1); }

#music-volume {
    width: 0; opacity: 0; margin-left: 0; pointer-events: none;
    transition: all 0.3s ease;
    height: 4px; appearance: none; background: rgba(255,255,255,0.2); border-radius: 2px;
}
#music-control:hover #music-volume {
    width: 80px; opacity: 1; margin: 0 10px; pointer-events: auto;
}
#music-volume::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: white; cursor: pointer;
}
#music-status { font-size: 0.75rem; margin-left: 4px; width: 30px; text-align: right; font-feature-settings: "tnum"; }

/* =========================================
   7. ANIMACJE I RWD
   ========================================= */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    #container { flex-direction: column; overflow-y: auto; padding-bottom: 90px; }
    #left-panel, #right-panel { width: 100%; height: auto; min-height: 100%; }
    #question-view { padding: 10px; }
    #question-main { padding: 16px; max-height: 85vh; }
    #question-title { font-size: 1.2rem; }
}

/* --- Pasek górny w quizie --- */
#quiz-top-bar {
    /* ZMIANA: 'relative' sprawia, że element zajmuje fizyczne miejsce */
    position: relative;
    top: auto;
    left: auto;
    right: auto;

    /* Wygląd */
    width: 100%;
    max-width: 800px; /* Taka sama szerokość jak pytania */
    margin-bottom: 24px; /* Odstęp od pytania */

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

#exit-quiz-btn {
    width: auto;
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: #fca5a5;
    padding: 6px 12px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

#exit-quiz-btn:hover {
    background-color: var(--danger);
    color: white;
}

#quiz-live-stats {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: none;
    margin: 0;
    padding: 0;
}

#quiz-live-stats span {
    color: var(--text-main);
    font-weight: 600;
    border: none;
    padding: 0;
    display: inline-block;
}

#quiz-live-stats span:not(:last-child)::after {
    content: "|";
    margin-left: 16px;
    color: rgba(255,255,255,0.2);
    font-weight: normal;
}

#live-correct {
    color: var(--success-border) !important;
}

/* =========================================
   8. MEDIA LOADER (SPINNER)
   ========================================= */
#media-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    z-index: 5;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   ULEPSZONY FEEDBACK (POPRAWNE ODPOWIEDZI)
   ========================================= */

.feedback-correct-container {
    text-align: left;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--success-border);
}

.feedback-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.feedback-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.feedback-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.feedback-text {
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
    margin-right: 12px;
}

.feedback-points {
    background: rgba(6, 78, 59, 0.6);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.4);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Klasa dla pełnych punktów - zielony */
.feedback-points.green {
    background: rgba(6, 78, 59, 0.6) !important;
    color: #6ee7b7 !important;
    border-color: rgba(52, 211, 153, 0.4) !important;
}

/* Klasa dla częściowych punktów - żółty */
.feedback-points.yellow {
    background: rgba(234, 179, 8, 0.6) !important;
    color: #fef08a !important;
    border-color: rgba(250, 204, 21, 0.4) !important;
}

.feedback-user-score {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 1.1rem;
}

.feedback-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-left: 8px;
}

.feedback-correct-container.user-wrong {
    border-left-color: var(--text-muted);
}

.feedback-points.gray {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-muted) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* =========================================
   9. INTEGRACJA MUZYKI Z QUIZ-TOP-BAR
   ========================================= */

/* Styl, gdy odtwarzacz jest wewnątrz paska quizu */
#music-control.music-in-bar {
    position: static; /* Przestaje być przyklejony do okna */
    background: transparent; /* Przezroczyste tło */
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    margin-left: auto; /* Przesuwa odtwarzacz na prawą stronę paska */
    z-index: auto;
    height: auto;
}

/* Dostosowanie suwaka głośności wewnątrz paska */
#music-control.music-in-bar #music-volume {
    background: rgba(255, 255, 255, 0.3);
    height: 6px;
    margin: 0 10px;
}

/* Upewnij się, że suwak jest widoczny po najechaniu (tak jak wcześniej) */
#music-control.music-in-bar:hover #music-volume {
    width: 80px;
    opacity: 1;
    pointer-events: auto;
}

/* Opcjonalnie: zmiana ikony na nieco mniejszą w pasku, jeśli trzeba */
#music-control.music-in-bar #music-toggle {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
}

/* =========================================
   10. WIDOK SZCZEGÓŁOWYCH ODPOWIEDZI
   ========================================= */
#detailed-answers-view {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    padding: 40px 20px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#detailed-answers-view h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

#detailed-answers-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detailed-question-card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.detailed-question-card.correct {
    border-left: 4px solid var(--success-border);
}

.detailed-question-card.incorrect {
    border-left: 4px solid var(--error-border);
}

.detailed-question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.detailed-question-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.detailed-question-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 8px 0;
}

.detailed-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.detailed-status-badge.correct {
    background: var(--success-bg);
    color: var(--success-border);
    border: 1px solid var(--success-border);
}

.detailed-status-badge.typo {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.detailed-status-badge.incorrect {
    background: var(--error-bg);
    color: var(--error-border);
    border: 1px solid var(--error-border);
}

.detailed-question-info {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detailed-question-text {
    margin: 16px 0;
    font-size: 1rem;
    line-height: 1.6;
}

.detailed-answers-section {
    margin-top: 16px;
}

.detailed-answers-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.detailed-answer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid transparent;
}

/* Nowy schemat kolorów dla odpowiedzi */

/* Zielony: poprawna odpowiedź, użytkownik ją zaznaczył */
.detailed-answer-item.selected-correct {
    background: rgba(6, 78, 59, 0.4);
    border-color: var(--success-border);
    border-width: 2px;
}

/* Żółty: poprawna odpowiedź, użytkownik jej nie zaznaczył */
.detailed-answer-item.unselected-correct {
    background: rgba(234, 179, 8, 0.2);
    border-color: #facc15;
    border-width: 2px;
}

/* Czerwony: błędna odpowiedź, użytkownik ją zaznaczył */
.detailed-answer-item.selected-wrong {
    background: rgba(69, 10, 10, 0.4);
    border-color: var(--error-border);
    border-width: 2px;
}

/* Szary: błędna odpowiedź, użytkownik jej nie zaznaczył */
.detailed-answer-item.unselected-wrong {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-muted);
}

.detailed-answer-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.detailed-answer-text {
    flex: 1;
}

.detailed-answer-points {
    background: rgba(6, 78, 59, 0.6);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.4);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
    margin-left: 8px;
}

/* Klasa dla pełnych punktów - zielony */
.detailed-answer-points.green {
    background: rgba(6, 78, 59, 0.6) !important;
    color: #6ee7b7 !important;
    border-color: rgba(52, 211, 153, 0.4) !important;
}

/* Klasa dla częściowych punktów - żółty */
.detailed-answer-points.yellow {
    background: rgba(234, 179, 8, 0.6) !important;
    color: #fef08a !important;
    border-color: rgba(250, 204, 21, 0.4) !important;
}

/* Klasa dla braku punktów - szary */
.detailed-answer-points.gray {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-muted) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.detailed-input-answer {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    font-family: monospace;
}

#summary-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

#view-all-answers {
    background: var(--accent);
    color: white;
    border: none;
    font-weight: 600;
    padding: 10px 24px;
}

#view-all-answers:hover {
    background: var(--accent-hover);
}

#close-detailed-answers {
    background: var(--bg-item);
    margin-top: 30px;
    padding: 10px 30px;
}

/* =========================================
   11. MEDIA W WIDOKU SZCZEGÓŁOWYCH ODPOWIEDZI
   ========================================= */
.detailed-media-section {
    margin-top: 20px;
}

.detailed-media-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.detailed-media-viewport {
    position: relative;
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.detailed-media-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detailed-media-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.detailed-media-image,
.detailed-media-video {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.detailed-media-audio {
    width: 100%;
    max-width: 500px;
}

.detailed-media-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.detailed-media-btn {
    background: var(--bg-item);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.detailed-media-btn:hover:not(:disabled) {
    background: var(--bg-item-hover);
    transform: translateY(-1px);
}

.detailed-media-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.detailed-media-counter {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}