/**
 * Module Header CSS
 * Styles for tp_module_header and in-modal content display
 * 
 * Companion to module-header.js
 * Created: 10 April 2026 (Move to Modal project)
 */

/* ═══════════════════════════════════════════════
   TP MODULE HEADER
   ═══════════════════════════════════════════════ */

.ysp-tp-module-header {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════
   MODAL STYLES (Swal-based)
   ═══════════════════════════════════════════════ */

/* Generic TP modal — clean, scrollable */
.ysp-tp-modal {
    border-radius: 12px !important;
    padding: 0 !important;
}

.ysp-tp-modal .swal2-html-container {
    padding: 16px !important;
    margin: 0 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.ysp-tp-modal .swal2-close {
    color: #666 !important;
    font-size: 1.5em !important;
    z-index: 10;
}

/* Audio programme modal */
.ysp-audio-programme-modal {
    border-radius: 12px !important;
    padding: 0 !important;
}

.ysp-audio-programme-modal .swal2-html-container {
    padding: 0 !important;
    margin: 0 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.ysp-audio-programme-modal .swal2-close {
    color: #666 !important;
    font-size: 1.5em !important;
}

/* ═══════════════════════════════════════════════
   IN-MODAL CONTENT SECTIONS
   ═══════════════════════════════════════════════ */

/* Classic path section dividers */
.ysp-tp-classic-section {
    margin-bottom: 8px;
}

/* Writing task textarea inside modal */
.ysp-tp-modal .ysp-tp-textarea {
    min-height: 150px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 12px;
    background: #fff;
    line-height: 1.6;
}

.ysp-tp-modal .ysp-tp-textarea:focus {
    outline: none;
    border-color: #005f73;
    box-shadow: 0 0 0 2px rgba(0, 95, 115, 0.1);
}

/* ═══════════════════════════════════════════════
   IN-MODAL QUIZ STYLES
   (Ensure quiz elements look correct inside Swal)
   ═══════════════════════════════════════════════ */

/* Quiz choices inside modal should be clickable */
.ysp-tp-modal .quiz-choice,
.ysp-tp-modal .ysp-comp-choice {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ysp-tp-modal .quiz-choice.answered,
.ysp-tp-modal .ysp-comp-choice.answered {
    cursor: default;
}

/* Score display inside modal */
.ysp-tp-modal .ysp-comp-results,
.ysp-tp-modal .ysp-tp-score-inner {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.ysp-tp-modal .ysp-comp-results.excellent,
.ysp-tp-modal .ysp-tp-score-inner.excellent {
    background: #d1fae5;
    border: 1px solid #10b981;
}

.ysp-tp-modal .ysp-comp-results.good,
.ysp-tp-modal .ysp-tp-score-inner.good {
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

.ysp-tp-modal .ysp-comp-results.needs-practice,
.ysp-tp-modal .ysp-tp-score-inner.needs-practice {
    background: #fee2e2;
    border: 1px solid #ef4444;
}

/* Revealed lexical targets inside modal */
.ysp-tp-modal .lexical-target-item {
    display: none;
}

.ysp-tp-modal .lexical-target-item.revealed-correct {
    border-left: 4px solid #10b981;
}

.ysp-tp-modal .lexical-target-item.revealed-incorrect {
    border-left: 4px solid #f59e0b;
}

/* ═══════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════ */

/* Module header: stack image above text on mobile */
@media (max-width: 680px) {
    .ysp-tp-module-header > div:first-child {
        flex-direction: column !important;
    }
    .ysp-tp-module-header > div:first-child > div:first-child {
        flex: none !important;
        min-height: 200px !important;
        width: 100% !important;
    }
}

/* Path cards: stack vertically on narrow screens */
@media (max-width: 560px) {
    .ysp-tp-module-header div[style*="display: flex"][style*="gap: 16px"] {
        flex-direction: column !important;
    }
    .ysp-tp-modal .swal2-html-container {
        padding: 10px !important;
    }
}