/* --- Variables CSS --- */

:root {
    --uce-blue: #003666;
    --uce-red: #c8102e;
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #555555;
    /* Colores para las 3 preguntas (A, B, C) */
    --color-q1: #ffd54f;
    /* Amarillo para A */
    --color-q2: #81d4fa;
    /* Azul claro para B */
    --color-q3: #a5d6a7;
    /* Verde claro para C */
    --color-correct: #d4edda;
    --color-correct-border: #28a745;
    --color-incorrect: #f8d7da;
    --color-incorrect-border: #dc3545;
    --bg-word-bank: #fae3e3;
    --border-radius: 12px;
    --transition-speed: 0.3s;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
}

.mt-4 {
    margin-top: 30px;
}

.hidden {
    display: none !important;
}


/* --- Encabezado --- */

.main-header {
    background-color: var(--bg-card);
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.uce-badge {
    background-color: var(--uce-red);
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    padding: 5px 18px;
    border-radius: 4px;
}

.main-header h1 {
    color: var(--uce-blue);
    font-size: 1.6rem;
    text-transform: uppercase;
}

.version-label {
    background-color: #e0e0e0;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    border: 1px solid #ccc;
}


/* --- Layout Interactivo S1 --- */

.interactive-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (min-width: 900px) {
    .interactive-workspace {
        grid-template-columns: 1fr 1fr;
    }
}

.questions-panel,
.answers-panel {
    padding: 25px;
}

.questions-panel h2,
.answers-panel h2 {
    color: var(--uce-blue);
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--bg-main);
    padding-bottom: 10px;
}

.question-box {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: background-color var(--transition-speed);
}

.question-trigger {
    width: 100%;
    text-align: left;
    background-color: #fcfcfc;
    border: none;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.question-trigger:hover {
    background-color: #f0f4f8;
}

.letter-badge {
    color: var(--uce-red);
    margin-right: 15px;
    font-weight: bold;
}

.question-text {
    flex-grow: 1;
}

.question-trigger .icon {
    margin-left: 10px;
    color: var(--uce-blue);
    transition: transform var(--transition-speed);
}

.question-box.active .icon {
    transform: rotate(180deg);
}

.options-container {
    max-height: 0;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transition: max-height var(--transition-speed) ease-out;
}

.question-box.active .options-container {
    max-height: 300px;
}

.option-btn {
    text-align: left;
    background: none;
    border: none;
    border-top: 1px solid #f0f0f0;
    padding: 12px 20px 12px 45px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.option-btn:hover:not(:disabled) {
    background-color: #f4f7f6;
    color: var(--uce-blue);
}

.option-btn.selected {
    background-color: var(--uce-blue);
    color: white;
    font-weight: bold;
}

.option-btn:disabled {
    cursor: not-allowed;
}


/* Colores S1 para las 3 preguntas */

.question-box.color-1 {
    background-color: var(--color-q1);
    border-color: var(--color-q1);
}

.question-box.color-2 {
    background-color: var(--color-q2);
    border-color: var(--color-q2);
}

.question-box.color-3 {
    background-color: var(--color-q3);
    border-color: var(--color-q3);
}

.question-box[class*="color-"] .question-trigger,
.question-box[class*="color-"] .options-container {
    background-color: transparent;
}

.answer-slots {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.answer-slot {
    display: flex;
    align-items: center;
    background-color: #fafafa;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    transition: all var(--transition-speed);
}

.answer-slot.filled {
    border-style: solid;
    border-color: var(--uce-blue);
    background-color: #f0f4f8;
}

.answer-slot.correct {
    background-color: var(--color-correct);
    border-color: var(--color-correct-border);
    color: #155724;
}

.answer-slot.incorrect {
    background-color: var(--color-incorrect);
    border-color: var(--color-incorrect-border);
    color: #721c24;
}

.slot-number {
    background-color: var(--text-muted);
    color: white;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-right: 15px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.answer-slot.filled .slot-number {
    background-color: var(--uce-blue);
}

.answer-slot.correct .slot-number {
    background-color: var(--color-correct-border);
}

.answer-slot.incorrect .slot-number {
    background-color: var(--color-incorrect-border);
}

.slot-text {
    font-size: 0.95rem;
    font-style: italic;
    color: #777;
}

.answer-slot.filled .slot-text {
    font-style: normal;
    color: var(--text-main);
    font-weight: 500;
}


/* Botones S1 */

.action-buttons,
.vocab-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.submit-btn {
    width: 100%;
    background-color: var(--uce-blue);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color var(--transition-speed), opacity 0.3s;
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--uce-red);
}

.retry-btn {
    background-color: var(--text-muted);
}

.retry-btn:hover:not(:disabled) {
    background-color: #222;
}


/* --- Lectura e Imagen Alineada Perfectamente a la Derecha --- */

.reading-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 60px;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

@media (min-width: 1024px) {
    .reading-section {
        flex-direction: row;
        align-items: flex-start;
    }
    .reading-section .blog-post {
        flex: 1;
    }
    .reading-section .image-container {
        flex: 0 0 45%;
        max-width: 500px;
        position: sticky;
        top: 20px;
    }
}

.blog-intro {
    background-color: var(--uce-blue);
    color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    position: relative;
}

.blog-intro::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 40px;
    border-width: 12px 12px 0;
    border-style: solid;
    border-color: var(--uce-blue) transparent transparent transparent;
}

.dialog-list li {
    margin-bottom: 20px;
    list-style: none;
    color: var(--text-muted);
}

.dialog-list li strong {
    color: var(--uce-blue);
}

.text-highlight {
    background-color: transparent;
    border-radius: 3px;
    padding: 2px 4px;
    transition: background-color 0.3s, color 0.3s;
}

.text-highlight.active {
    color: #000;
    font-weight: 500;
}

.text-highlight.active.q-1-target {
    background-color: var(--color-q1);
}

.text-highlight.active.q-2-target {
    background-color: var(--color-q2);
}

.text-highlight.active.q-3-target {
    background-color: var(--color-q3);
}

.image-container figure {
    width: 100%;
    margin: 0;
    display: block;
}

.amplified-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    display: block;
}


/* --- SECCIÓN 2: VOCABULARIO --- */

.vocabulary-section {
    padding: 40px;
    margin-bottom: 60px;
}

.vocab-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.vocab-header h2 {
    font-size: 1.6rem;
    font-weight: normal;
}

.instructions-block {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.letter-badge-red {
    color: var(--uce-red);
    font-weight: bold;
    font-size: 1.2rem;
}

.reference-image-small {
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.reference-image-small img {
    width: 100%;
    display: block;
}

.word-bank-container {
    background-color: var(--bg-word-bank);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 80px;
    margin-bottom: 30px;
    transition: background-color var(--transition-speed);
}

.word-bank-container.drag-over {
    background-color: #f1c9c9;
    border: 2px dashed var(--uce-red);
}

.draggable-word {
    background-color: #ffffff;
    color: var(--text-main);
    padding: 8px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    cursor: grab;
    font-size: 1rem;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-block;
    transition: all 0.2s;
}

.draggable-word:hover {
    background-color: #f0f4f8;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.draggable-word.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-column {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.category-title {
    padding: 15px;
    text-align: center;
    color: white;
    font-size: 1.2rem;
}

.positive-title {
    background-color: #4caf50;
}

.negative-title {
    background-color: #f44336;
}

.neutral-title {
    background-color: #607d8b;
}

.category-zone {
    min-height: 180px;
    padding: 15px;
    background-color: #fafafa;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px;
    transition: background-color 0.2s;
}

.category-zone.drag-over {
    background-color: #e3f2fd;
}

.word-correct {
    background-color: var(--color-correct) !important;
    border-color: var(--color-correct-border) !important;
    color: #155724 !important;
}

.word-incorrect {
    background-color: var(--color-incorrect) !important;
    border-color: var(--color-incorrect-border) !important;
    color: #721c24 !important;
}


/* --- SECCIÓN 3: GRAMÁTICA --- */

.grammar-section {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 60px;
}

.grammar-list {
    font-size: 1.1rem;
    line-height: 2.2;
    margin-left: 20px;
    margin-bottom: 20px;
    list-style: none;
    padding-left: 0;
}

.grammar-sentence-row {
    margin-bottom: 15px;
    line-height: 2.2;
}

.grammar-option {
    display: inline-block;
    padding: 6px 14px;
    margin: 0 4px;
    border: 2px solid transparent;
    border-radius: 6px;
    background-color: #e6edf3;
    color: var(--uce-blue);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.grammar-option:hover:not(:disabled) {
    background-color: #cce0ff;
    transform: translateY(-1px);
}

.grammar-option.selected {
    background-color: var(--uce-blue);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.grammar-option:disabled {
    cursor: not-allowed;
}

.grammar-option.selected.correct {
    background-color: var(--color-correct-border);
    color: #ffffff;
}

.grammar-option.selected.incorrect {
    background-color: var(--color-incorrect-border);
    color: #ffffff;
}

.main-footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
}