/* ---------------------------------------------------------
   GLOBAL THEME VARIABLES (Dialogue = #f28c52)
--------------------------------------------------------- */

:root {
    --ded-accent: #f28c52;          /* Dialogue colour */
    --ded-accent-dark: #d9743f;     /* Hover/active */
    --ded-accent-tint: #f7e1d4;     /* Soft tint for hovers */
    --ded-border: #b8b2ac;          /* Warm neutral border */
    --ded-bg-light: #F7F7F5;        /* Player + completion bg */
    --ded-bg-option: #FAFAF8;       /* Option bg */
    --ded-bg-option-hover: #F0F0EC; /* Option hover */
}

/* ============================================================
   DED AUDIO PAGE — Structural Wrapper
   ============================================================ */

.ded-audio-page {
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 30px 40px;
    background: #fff;
    border-radius: 12px; /* matches actor-accent-radius */
    border: 1px solid var(--ded-border);
    box-shadow: 0 4px 8px rgba(0,0,0,0.18); /* matches actor-shadow-dark */
    font-family: var(--ded-font-body);
    color: #333; /* neutral text, not actor-dependent */
    line-height: 1.6;
}

/* Optional: lead text block for audio pages */
.ded-audio-page .audio-lead {
    font-family: var(--ded-font-body);
    font-size: 1.125rem;
    line-height: 1.55;
    font-weight: 400;
    color: #555;
    margin: 1rem 0 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--ded-accent);
    border-right: 4px solid var(--ded-accent);
    max-width: 65ch;
}


/* ---------------------------------------------------------
   PLAYER SHELL
--------------------------------------------------------- */

.ded-audio-shell {
    background: var(--ded-bg-light);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid var(--ded-border);
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   PLAY / PAUSE BUTTON
--------------------------------------------------------- */

.ded-play-btn {
    border: 1px solid var(--ded-border);
    background: transparent;
    color: #333;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}

.ded-play-btn:hover {
    background: rgba(0,0,0,0.03);
}

.ded-play-btn:active {
    transform: scale(0.97);
}

/* Play icon */
.ded-play-icon {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid #333;
}

/* Pause icon */
.ded-pause-icon {
    display: inline-flex;
    gap: 3px;
}

.ded-pause-icon span {
    display: block;
    width: 3px;
    height: 12px;
    background: #333;
}

/* ---------------------------------------------------------
   PROGRESS BAR
--------------------------------------------------------- */

.ded-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
}

.ded-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #E0E0DC;
    cursor: pointer;
}

.ded-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--ded-accent);
    width: 0%;
    transition: width 0.08s linear;
}

.ded-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.18);
    pointer-events: none;
}

/* ---------------------------------------------------------
   TIME + STATUS
--------------------------------------------------------- */

.ded-time-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #444;
    min-width: 90px;
    justify-content: flex-end;
}

.ded-time-divider {
    opacity: 0.6;
}

/* Hide status text until Play */
#ded-audio-status-text {
    visibility: hidden;
}

.ded-audio-status {
    margin-top: 8px;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ded-audio-divider {
    opacity: 0.5;
}

/* ---------------------------------------------------------
   QUESTION CARDS
--------------------------------------------------------- */

.ded-question-card {
    display: none;
}

.ded-question-card {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid var(--ded-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ded-question-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 4px;
    font-weight: 700;
}

/* Base micro-transitions for stack shifting */
.ded-question-card {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Smooth fade + slide-down when a question moves to the top */
.ded-question-card.ded-reveal {
    opacity: 0;
    transform: translateY(-20px);
    animation: dedQuestionReveal .7s ease forwards;
}

@keyframes dedQuestionReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.ded-question-text {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #222;
}

.ded-question-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ded-btn-option {
    border-radius: 6px;
    border: 1px solid var(--ded-border);
    background: var(--ded-bg-option);
    padding: 6px 10px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.ded-btn-option:hover {
    background: var(--ded-bg-option-hover);
}

.ded-btn-option:active {
    transform: scale(0.98);
}

/* Correct / Incorrect */
.ded-btn-option.ded-correct {
    border-color: #2E8B57;
    background: #E7F6EC;
}

.ded-btn-option.ded-incorrect {
    border-color: #C0392B;
    background: #FDECEA;
}

.ded-feedback {
    margin-top: 6px;
    font-size: 13px;
    color: #444;
}

.ded-sequence-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.ded-sequence-item {
    padding: 8px 12px;
    background: var(--ded-bg-option);
    border: 1px solid var(--ded-border);
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.ded-sequence-item:hover {
    background: var(--ded-bg-option-hover);
}

.ded-sequence-item.dragging {
    opacity: 0.7;
    border-color: var(--ded-accent);
    transform: scale(0.99);
}


/* ---------------------------------------------------------
   COMPLETION BLOCK
--------------------------------------------------------- */

.ded-audio-complete {
    display: none;
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--ded-bg-light);
    border: 1px solid var(--ded-border);
}

.ded-audio-complete h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.ded-audio-complete p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.ded-btn-primary {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--ded-accent);
    color: #FFFFFF;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.08s ease;
}

.ded-btn-primary:hover {
    background: var(--ded-accent-dark);
}

.ded-btn-primary:active {
    transform: scale(0.98);
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 600px) {
    .ded-audio-shell {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ded-time-display {
        justify-content: flex-start;
    }
}

.ded-question-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.ded-btn-secondary {
    padding: 6px 14px;
    border-radius: 999px;
    background: #E0E0DC;
    color: #333;
    font-size: 14px;
    border: 1px solid var(--ded-border);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.08s ease;
}

.ded-btn-secondary:hover {
    background: #D5D5D0;
}

.ded-btn-secondary:active {
    transform: scale(0.98);
}

/* ---------------------------------------------------------
   SUMMARY CARD
--------------------------------------------------------- */

.ded-summary-card {
    background: var(--ded-bg-light);
    border: 2px solid var(--ded-border);
    border-radius: 16px;
    padding: 24px;
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(20px);
    animation: dedFadeUp 0.6s ease forwards;
}

.ded-summary-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--ded-accent-dark);
}

.ded-summary-score {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #444;
}

/* BREAKDOWN LIST */
.ded-breakdown-list {
    text-align: left;
    margin-bottom: 24px;
}

.ded-breakdown-item {
    background: var(--ded-bg-option);
    border: 1px solid var(--ded-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: dedFadeIn 0.4s ease;
}

.ded-breakdown-item.correct {
    border-color: #4CAF50;
}

.ded-breakdown-item.incorrect {
    border-color: #E53935;
}

/* BUTTONS */
.ded-summary-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.ded-summary-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid var(--ded-accent);
    background: white;
    cursor: pointer;
    transition: 0.25s ease;
}

.ded-summary-btn:hover {
    background: var(--ded-accent-tint);
}

.ded-summary-primary {
    background: var(--ded-accent);
    color: white;
}

.ded-summary-primary:hover {
    background: var(--ded-accent-dark);
}

/* ANIMATIONS */
@keyframes dedFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes dedFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ded-status-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    text-align: center;
    font-style: italic;
}

/* ---------------------------------------------------------
   MULTIPLE CHOICE CHECKBOX STYLE
--------------------------------------------------------- */

.ded-question-card.mc .ded-btn-option {
    position: relative;
    padding-left: 36px !important;
    text-align: left;
    justify-content: flex-start;
}

.ded-question-card.mc .ded-btn-option::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

.ded-question-card.mc .ded-btn-option.selected::before {
    background: #0073e6;
    border-color: #0073e6;
}

.ded-question-card.mc .ded-btn-option.selected::after {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-55%);
    font-size: 12px;
    color: #fff;
    font-weight: bold;
}
