﻿:root {
    --c1: #1e40af;
    /* Nghĩa bề mặt */
    --c2: #16a34a;
    /* Nghĩa sâu */
    --c3: #ea580c;
    /* Cá nhân */
    --c4: #2563eb;
    /* Đời thực */
    --c5: #9333ea;
    /* Cảm xúc */
    --c6: #0d9488;
    /* Hành động */
    --c7: #db2777;
    /* Phát âm */
    --c8: #ca8a04;
    /* Ngữ điệu */
    --c9: #4f46e5;
    /* Cấu trúc */
    --c10: #059669;
    /* Biến đổi */
}

/* Modal styles */
.learning-modal {
    font-family: 'Inter', sans-serif;
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

    .learning-modal.show {
        display: block;
        animation: fadeIn 0.3s ease-in-out;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.learning-modal-content {
    background-color: #f8fafc;
    margin: 40px auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-in-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.learning-close-btn {
    color: #94a3b8;
    float: right;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
    transition: color 0.2s;
}

    .learning-close-btn:hover,
    .learning-close-btn:focus {
        color: #0f172a;
        text-decoration: none;
    }

/* GRID LAYOUT */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

    .grid-container * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        font-family: 'Inter', sans-serif;
    }

@media(max-width: 800px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}

/* BLOCKS */
.block {
    background: white;
    border-radius: 12px;
    border: 2px solid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.b1 {
    border-color: var(--c1);
}

.b2 {
    border-color: var(--c2);
}

.b3 {
    border-color: var(--c3);
}

.b4 {
    border-color: var(--c4);
}

.b5 {
    border-color: var(--c5);
}

.b6 {
    border-color: var(--c6);
}

.b7 {
    border-color: var(--c7);
}

.b8 {
    border-color: var(--c8);
}

.b9 {
    border-color: var(--c9);
}

.b10 {
    border-color: var(--c10);
}

.step-block-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.b-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    margin-right: 12px;
}

.step-block-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
}

.step-block-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flex-row {
    flex-direction: row;
    flex-wrap: wrap;
}

.vertical-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* INPUTS & BUTTONS */
.inline-input {
    border: none;
    border-bottom: 2px solid #cbd5e1;
    background: transparent;
    font-size: 1rem;
    padding: 2px 4px;
    outline: none;
    text-align: center;
    color: #1d4ed8;
    font-weight: 600;
}

    .inline-input:focus {
        border-bottom-color: #3b82f6;
    }

    .inline-input.correct-answer,
    .input-line.correct-answer {
        color: #16a34a;
        border-color: #16a34a;
    }

    .inline-input.long {
        width: 150px;
    }

    .inline-input.small {
        width: 60px;
    }

.input-line {
    width: 100%;
    border: 2px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 1rem;
}

.action-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 8px 12px !important;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 8px;
    width: 100%;
}

    .action-btn:hover {
        filter: brightness(0.95);
    }

.exercise {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    margin-top: auto;
    width: 100%;
}

/* --- SPECIFIC BLOCKS --- */

/* B1 */
.b1 .step-block-header {
    color: var(--c1);
}

.b1 .b-num {
    background: var(--c1);
}

.vocab-focus {
    text-align: center;
    background: #eff6ff;
    padding: 10px;
    border-radius: 8px;
}

    .vocab-focus strong {
        font-size: 1.4rem;
        color: var(--c1);
    }

.vocab-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

    .vocab-table td {
        border: 1px solid #e2e8f0;
        padding: 6px;
        text-align: center;
    }

.speak-btn {
    display: block;
    width: 100%;
    padding: 6px;
    margin: 4px 0;
    border: none;
    background: #d1fae5;
    border-radius: 4px;
    cursor: pointer;
    color: var(--c1);
    font-weight: 500;
}

    .speak-btn.is-speaking,
    .p-btn.is-speaking,
    .action-btn.is-speaking {
        background: #dcfce7;
    }

/* B2 */
.b2 .step-block-header {
    color: var(--c2);
}

.b2 .b-num {
    background: var(--c2);
}

.explanation {
    font-style: italic;
    color: var(--c2);
}

.radio-opt {
    display: block;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
}

    .radio-opt:hover {
        background: #f0fdf4;
    }

.correct-opt.active {
    background: #dcfce7;
    color: #166534;
    font-weight: bold;
}

.speech-bubble {
    background: #dcfce7;
    padding: 10px;
    border-radius: 12px 12px 12px 0;
    display: inline-block;
    border: 1px solid #86efac;
    color: #166534;
    width: 100%;
}

.speak-plain {
    cursor: pointer;
    font: inherit;
}

/* B3 */
.b3 .step-block-header {
    color: var(--c3);
}

.b3 .b-num {
    background: var(--c3);
}

.highlight-box {
    background: #ffedd5;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    color: var(--c3);
    text-align: center;
    border: 1px solid #fed7aa;
}

.options-list {
    list-style: none;
    margin: 10px 0;
}

    .options-list li {
        padding: 6px;
        cursor: pointer;
        border-radius: 4px;
    }

        .options-list li:hover {
            background: #ffedd5;
        }

        .options-list li.selected {
            background: #fdba74;
            font-weight: bold;
        }

/* B4 */
.b4 .step-block-header {
    color: var(--c4);
}

.b4 .b-num {
    background: var(--c4);
}

.dialogue {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.person {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

    .person.right {
        align-self: flex-end;
        align-items: flex-end;
    }

    .person span {
        font-size: 0.8rem;
        color: #64748b;
        margin-bottom: 2px;
    }

.bubble {
    padding: 10px 14px;
    border-radius: 16px;
}

    .bubble.outline {
        border: 1px solid #cbd5e1;
        border-bottom-left-radius: 0;
    }

    .bubble.filled {
        background: #dbeafe;
        color: #1e40af;
        border-bottom-right-radius: 0;
    }

/* B5 */
.b5 .step-block-header {
    color: var(--c5);
}

.b5 .b-num {
    background: var(--c5);
}

.emotions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emo {
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: 0.2s;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.emo-icon {
    width: 60px;
    height: 60px;
}

.emo:hover,
.emo.active {
    background: #f3e8ff;
    transform: scale(1.1);
    font-weight: bold;
    color: var(--c5);
}

/* B6 */
.b6 .step-block-header {
    color: var(--c6);
}

.b6 .b-num {
    background: var(--c6);
}

.action-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-card {
    background: #ccfbf1;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    cursor: grab;
    border: 1px solid #5eead4;
    color: #0f766e;
}

.sort-area {
    min-height: 50px;
    background: white;
    border: 1px dashed var(--c6);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* B7 */
.b7 .step-block-header {
    color: var(--c7);
}

.b7 .b-num {
    background: var(--c7);
}

.red {
    color: var(--c7);
    font-weight: bold;
}

.pronounce-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.p-btn {
    text-align: left;
    padding: 8px;
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

    .p-btn:hover {
        background: #fce7f3;
    }

    .p-btn span {
        color: var(--c7);
        font-weight: bold;
        float: right;
    }

/* B8 */
.b8 .step-block-header {
    color: var(--c8);
}

.b8 .b-num {
    background: var(--c8);
}

.tone-card-container {
    width: 100%;
    border-radius: 8px;
}

    .tone-card-container:nth-child(1) {
        background: #CCFBF1;
    }

    .tone-card-container:nth-child(2) {
        background: #FFF7D6;
    }

    .tone-card-container:nth-child(3) {
        background: lightpink;
    }

.tone-card {
    padding: 10px;
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
}

    .tone-card strong {
        color: #854d0e;
    }

    .tone-card p {
        font-weight: bold;
        margin: 4px 0;
    }

    .tone-card span {
        font-size: 0.8rem;
        color: #a16207;
    }

/* B9 */
.b9 .step-block-header {
    color: var(--c9);
}

.b9 .b-num {
    background: var(--c9);
}

.structure {
    text-align: center;
    font-size: 1.2rem;
    background: #e0e7ff;
    padding: 15px;
    border-radius: 8px;
}

    .structure .labels {
        display: flex;
        justify-content: space-around;
        font-size: 0.9rem;
        color: var(--c9);
        margin-top: 10px;
    }

.match-words {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mw {
    background: #c7d2fe;
    color: #3730a3;
    padding: 6px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* B10 */
.b10 .step-block-header {
    color: var(--c10);
}

.b10 .b-num {
    background: var(--c10);
}

.sentences ol {
    padding-left: 20px;
    line-height: 1.8;
}

.badge {
    display: inline-block;
    background: #d1fae5;
    color: #047857;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    border: 1px solid #6ee7b7;
    margin: 10px 0;
    font-size: initial;
}

/* FOOTER / MINI GAME */
.footer {
    display: flex;
    gap: 20px;
    margin-top: 24px;
}

.summary,
.minigame {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid;
}

.summary {
    border-color: var(--c2);
}

.minigame {
    border-color: var(--c3);
}


.summary h3 {
    color: var(--c2);
}

.minigame h3 {
    color: var(--c3);
}

.summary h3,
.minigame h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

    .summary-grid > label {
        padding: 6px;
        border-radius: 8px;
        padding: 6px;
    }

.minigame ol {
    padding-left: 20px;
    line-height: 2;
}

.game-input {
    border: none;
    border-bottom: 2px solid #cbd5e1;
    width: 120px;
    padding: 2px;
    outline: none;
}

    .game-input.correct {
        border-bottom-color: #10b981;
        color: #10b981;
        font-weight: bold;
    }

.game-hint {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    background: #d1fae5;
    color: #047857;
    font-weight: bold;
    border: 1px solid #6ee7b7;
}

.text-center {
    text-align: center;
}

.footer-msg {
    text-align: center;
    font-weight: 900;
    color: #ef4444;
    margin-top: 20px;
    font-size: 1.1rem;
}

@media(max-width: 800px) {
    .footer {
        flex-direction: column;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.btn-nav-wrapper {
    display: flex;
    margin-top: 1rem;
    justify-content: space-between;
}

.btn-nav {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    width: 65px;
}
