/* --- CSS cho các bài học Kaiwa tiếng Nhật --- */
/* Bạn có thể giữ nguyên file này cho tất cả các bài học */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6; 
    margin: 0; 
    background-color: #f3eadc; 
}
.page-header, .page-footer { 
    text-align: center; 
    padding: 20px; 
}
.scene-container { 
    max-width: 900px; 
    margin: 20px auto; 
    position: relative; 
}
.scene-background-image {
    display: block; 
    width: 100%; 
    height: auto; 
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: opacity 0.4s ease;
}
.dialogue-overlay {
    position: relative; 
    margin-top: -80px; 
    margin-left: 20px; 
    margin-right: 20px;
    padding: 25px; 
    background: rgba(200, 180, 140, 0.55);
    border-radius: 15px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}
@media (max-width: 600px) {
    .dialogue-overlay { 
        margin-top: -40px; 
        padding: 15px; 
        margin-left: 10px; 
        margin-right: 10px; 
    }
}
.dialogue-display-window { 
    color: #333; 
    min-height: 120px; 
    transition: opacity 0.15s ease; 
}
.speaker-container { 
    display: flex; 
    align-items: center; 
    margin-bottom: 10px; 
}
.speaker { 
    font-weight: 800; 
    font-size: 1.1rem; 
}
.speaker.yamada { color: #34495e; }
.speaker.suzuki { color: #e67e22; }
.speaker.an { color: #e84393; }
.dialogue-content-wrapper { 
    display: flex; 
    align-items: flex-start; 
    gap: 15px; 
}
.dialogue-play-btn { 
    background-color: #228B22; 
    border: none; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
    font-size: 1.2rem; 
    cursor: pointer; 
    color: white; 
    transition: all 0.2s;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0;
}
.dialogue-texts { 
    flex-grow: 1; 
}
.japanese-text {
    font-size: clamp(1.2rem, 4vw, 1.6rem); 
    line-height: 1.8;
    margin: 0 0 8px 0; 
    color: #2c3e50; 
    font-weight: 500;
}
ruby { 
    ruby-align: center; 
}
rt { 
    font-size: 0.6em; 
    color: #7f8c8d; 
    user-select: none; 
}
.vietnamese-text {
    font-size: 1rem; 
    color: #555; 
    margin-top: 0;
    border-left: 3px solid #228B22; 
    padding-left: 10px; 
}
.highlight-word { 
    background-color: #fffa90; 
    border-radius: 4px; 
}
.grammar-teinei, .grammar-futsuu {
    font-weight: bold; 
    border-bottom: 2px dotted; 
    padding: 0 2px; 
    border-radius: 3px;
}
.grammar-teinei { 
    color: #2980b9; 
    border-color: #2980b9; 
    background-color: rgba(52, 152, 219, 0.05); 
}
.grammar-futsuu { 
    color: #c0392b; 
    border-color: #c0392b; 
    background-color: rgba(231, 76, 60, 0.05); 
}
.controls-wrapper { 
    margin-top: 20px; 
    padding-top: 10px; 
    border-top: 1px solid rgba(0,0,0,0.05); 
}
.scene-nav { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 15px; 
}
.scene-btn {
    background-color: #f0f0f0; 
    border: 1px solid #ccc; 
    color: #555;
    padding: 5px 15px; 
    border-radius: 15px; 
    cursor: pointer; 
    transition: all 0.2s ease;
}
.scene-btn.active { 
    background-color: #34495e; 
    color: white; 
    border-color: #34495e; 
    font-weight: bold; 
}
.dialogue-nav { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 20px; 
}
#counter { 
    color: #777; 
    font-weight: 500; 
    min-width: 50px; 
    text-align: center; 
}
.nav-btn {
    background-color: white; 
    border: 1px solid #ccc; 
    color: #333;
    padding: 8px 20px; 
    border-radius: 20px; 
    cursor: pointer; 
    transition: all 0.2s ease;
}
.nav-btn:disabled { 
    opacity: 0.5; 
    cursor: default; 
}


/* --- CSS CHO PHẦN TỪ VỰNG MỚI --- */

/* --- CSS CHO PHẦN TỪ VỰNG MỚI (ĐÃ CẬP NHẬT) --- */

.vocabulary-section {
    /* THAY ĐỔI: Đổi nền trắng thành màu pastel xanh ngọc */
    background-color: #e0f2f1; /* Pastel xanh ngọc */
    padding: 30px 20px;
    margin-top: 40px;
}
.vocabulary-container {
    max-width: 900px;
    margin: 0 auto;
}
.vocabulary-section h3 {
    text-align: center;
    font-size: 1.8rem;
    color: #34495e;
    margin-bottom: 25px;
    border-bottom: 2px solid #e67e22;
    padding-bottom: 10px;
    display: inline-block;
}
.vocabulary-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.vocab-card {
    background: #fdfdfd; /* Hơi ngả trắng để nổi bật trên nền xanh */
    border: 1px solid #cce8e6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    /* THÊM MỚI: Thêm hiệu ứng chuyển động mượt mà */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

/* THÊM MỚI: Hiệu ứng khi di chuột vào */
.vocab-card:hover {
    background-color: #FFFCBC; /* Màu vàng nhạt khi hover  #fffde7, #fffa90*/
    transform: translateY(-4px); /* Hơi nhấc thẻ lên một chút */
    box-shadow: 0 8px 25px rgba(0,0,0,0.08); /* Tăng bóng đổ để tạo chiều sâu */
}

.vocab-word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* ... các phần còn lại của CSS giữ nguyên ... */



.vocab-word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.vocab-term {
    margin: 0;
    font-size: 1.7rem;
    color: #2c3e50;
    font-weight: 600;
}
.vocab-play-btn {
    background-color: #e67e22;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vocab-play-btn:hover {
    background-color: #d35400;
}
.vocab-details p {
    margin: 5px 0;
    font-size: 1rem;
    color: #555;
}
.vocab-details .label {
    font-weight: bold;
    color: #333;
    margin-right: 8px;
    display: inline-block;
    min-width: 80px; /* Căn chỉnh các dòng cho đẹp */
}
.vocab-example {
    margin-top: auto; /* Đẩy phần ví dụ xuống dưới cùng */
    padding-top: 15px;
    border-top: 1px dashed #ccc;
    margin-top: 15px;
}
.example-jp {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}
.jp-sentence {
    margin: 0;
    font-size: 1.1rem;
    color: #34495e;
    font-weight: 500;
    line-height: 1.6;
}
.vi-sentence {
    margin: 0;
    font-size: 0.95rem;
    color: #7f8c8d;
    font-style: italic;
    padding-left: 10px;
    border-left: 2px solid #e67e22;
}

/* Tối ưu cho màn hình nhỏ hơn */
@media (max-width: 400px) {
    .vocabulary-list {
        grid-template-columns: 1fr; /* 1 cột trên mobile */
    }
}

/* --- CSS CHO PHẦN NGỮ PHÁP VÀ LUYỆN TẬP --- */


/* ========================================= */
/* CSS MỚI CHO PHẦN NGỮ PHÁP (ĐỒNG BỘ HÓA) */
/* ========================================= */
<!--
.grammar-section {
    background-color: #f0f4f8; /* Màu nền tổng thể hơi khác một chút để phân biệt */
    padding: 40px 20px;
}

.grammar-container {
    max-width: 900px;
    margin: 0 auto;
}

.grammar-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 35px;
    border-bottom: 4px solid #3498db; /* Đường gạch chân xanh dương */
    display: inline-block;
    padding-bottom: 10px;
}

/* --- THẺ NGỮ PHÁP (GIỐNG THẺ TỪ VỰNG) --- */
.grammar-card {
    background-color: #ffffff;
    border-radius: 15px; /* Bo tròn nhiều hơn chút cho hiện đại */
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06); /* Bóng đổ mềm mại hơn */
    border: 1px solid #eef2f7;
    transition: all 0.3s ease;
}

.grammar-card:hover {
    transform: translateY(-5px); /* Hiệu ứng nhấc lên khi di chuột */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: #3498db; /* Viền chuyển xanh khi hover */
}

/* Tiêu đề nhỏ trong thẻ */
.grammar-card h3 {
    font-size: 1.4rem;
    color: #2980b9; /* Màu xanh chủ đạo */
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 2px dashed #cbd5e0; /* Đường gạch nét đứt nhẹ nhàng */
    margin-bottom: 20px;
}

/* Phần nội dung giải thích */
.grammar-explanation {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 25px;
}

/* --- CẶP CÂU VÍ DỤ (STYLE MỚI QUAN TRỌNG) --- */
.grammar-example-pair {
    margin-bottom: 20px;
    padding-left: 15px; /* Thụt lề nhẹ cho cả khối ví dụ */
}

.grammar-jp {
    /* Font chữ to, rõ, áp dụng fix lỗi furigana */
    font-size: 1.3rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 2.2; /* QUAN TRỌNG: Giữ furigana không bị dính */
}

/* Căn chỉnh riêng cho furigana trong ngữ pháp */
.grammar-jp ruby {
    vertical-align: bottom;
}

.grammar-vn {
    /* Style giống hệt phần dịch nghĩa của Dialogue/Vocab */
    font-size: 1rem;
    color: #666;
    font-style: italic;
    padding-left: 12px;
    border-left: 4px solid #e67e22; /* Màu cam làm điểm nhấn */
    margin-top: 0;
    margin-bottom: 0;
}

/* Điểm nhấn ngữ pháp (màu đỏ) */
.grammar-point {
    color: #c0392b;
    font-weight: 700;
    background-color: rgba(231, 76, 60, 0.1); /* Nền đỏ rất nhạt để nhấn mạnh hơn */
    padding: 2px 5px;
    border-radius: 4px;
}

/* Công thức ngữ pháp */
.grammar-formula {
    background-color: #e8f4fc; /* Nền xanh dương rất nhạt */
    border: 2px solid #bde0fe;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 20px 0;
    font-family: monospace, sans-serif; /* Font hơi khác chút để giống "code" */
    font-size: 1.1rem;
    color: #2c3e50;
}
-->

/* --- CSS MỚI CHO PHẦN NGỮ PHÁP (STYLE HỘI THOẠI/TỪ VỰNG) --- */


/* --- CSS MỚI CHO PHẦN NGỮ PHÁP (ĐÃ ĐIỀU CHỈNH MÀU SẮC) --- */

.grammar-section {
    background-color: #f8f9fa;
    padding: 40px 20px;
}

.grammar-container {
    max-width: 900px;
    margin: 0 auto;
}

.grammar-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 40px;
}

/* --- THẺ NGỮ PHÁP CHÍNH --- */
.grammar-card {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    /* Thêm transition để hiệu ứng hover mượt mà */
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* YÊU CẦU 3: Hiệu ứng hover màu vàng nhạt */
.grammar-card:hover {
    background-color: #fffde7; /* Màu vàng nhạt giống phần từ vựng */
    transform: translateY(-5px); /* Giữ lại hiệu ứng nhấc lên cho đẹp mắt */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.grammar-card h3 {
    font-size: 1.6rem;
    color: #2980b9;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eef2f7;
}

/* YÊU CẦU 1: Điều chỉnh hộp giải thích */
.grammar-explanation {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #34495e;
    margin-bottom: 25px;
    background-color: #eefbfb; /* Màu nền xanh ngọc nhạt */
    padding: 12px 18px;      /* Giảm padding cho gọn hơn */
    border-radius: 5px;       /* Giảm bo tròn */
    border-left: 5px solid #2980b9;
}

.grammar-point {
    color: #c0392b;
    font-weight: 700;
    background-color: #fff5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- KHỐI VÍ DỤ MỚI --- */
.example-block {
    margin-bottom: 20px;
    padding: 15px 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

/* YÊU CẦU 2: Đổi màu chữ ví dụ */
.example-jp {
    font-size: 1.3rem;
    font-weight: 500;
    color: #228B22; /* Xanh lá cây tươi, đậm (ForestGreen) */
    margin: 0 0 12px 0;
    line-height: 2.4;
}

.example-jp ruby {
    ruby-align: center;
}
.example-jp rt {
    font-size: 0.6em;
    color: #7f8c8d;
    font-weight: normal;
}

.example-vn {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    margin: 0;
    padding-left: 15px;
    border-left: 3px solid #27ae60;
}

/* --- Responsive cho mobile --- */
@media (max-width: 768px) {
    .grammar-card {
        padding: 20px;
    }
    .grammar-explanation {
        padding: 15px;
        font-size: 1rem;
    }
    .example-jp {
        font-size: 1.15rem;
        line-height: 2.2;
    }
}






.practice-list {
    list-style: none;
    padding-left: 0;
}

.practice-list li {
    font-size: 1.1rem;
    padding: 10px 0;
    border-bottom: 1px dashed #ced4da;
}

.practice-list li:last-child {
    border-bottom: none;
}

/* Tối ưu hóa cho di động */
@media (max-width: 768px) {
    .grammar-section {
        padding: 30px 15px;
    }
    
    .grammar-section h2 {
        font-size: 1.8rem;
    }

    .grammar-card {
        padding: 20px;
    }

    .grammar-card h3 {
        font-size: 1.3rem;
    }

    .grammar-card p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .example-jp {
        font-size: 1.1rem !important;
    }
}


/* --- CSS CHO PHẦN BÀI TẬP TRẮC NGHIỆM TƯƠNG TÁC --- */
.quiz-section {
   /* THAY ĐỔI: Đổi nền trắng xám thành màu pastel xanh ngọc */
    background-color: #e0f2f1; /* Pastel xanh ngọc - GIỐNG HỆT phần từ vựng */
   /* background-color: #f8f9fa;  Nền chung của cả khu vực */
    padding: 40px 20px;
}

.quiz-section h2 {
    text-align: center;
    font-size: 2rem;
    color: #34495e;
    margin-bottom: 30px;
}

.quiz-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    /* Tự động tạo các cột co giãn, tối thiểu 320px */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.quiz-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    border: 1px solid #e9ecef;

    
   

}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 20px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    text-align: left;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative; /* Dùng cho việc định vị icon đúng/sai */
}

.option-btn:not(:disabled):hover {
    background-color: #fffde7; /* MÀU VÀNG NHẠT MONG MUỐN */
    border-color: #fce183;   /* Một màu viền vàng đậm hơn cho đẹp mắt */
    transform: translateY(-2px); /* Hơi nhấc nút lên một chút */
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); /* Thêm bóng đổ nhẹ */
}



/* --- Các trạng thái của nút đáp án --- */
.option-btn.correct {
    background-color: #e6f9f0;
    border-color: #28a745;
    color: #155724;
    font-weight: bold;
}

.option-btn.incorrect {
    background-color: #fce8e6;
    border-color: #dc3545;
    color: #721c24;
    font-weight: bold;
}

/* Thêm icon X và chữ "Chưa đúng" cho đáp án sai */
.option-btn.incorrect::after {
    content: '✗ Chưa đúng';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc3545;
    font-weight: bold;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}


.explanation-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #e7f3fe;
    border-left: 5px solid #007bff;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
}

/* =============================================================== */
/* === TÙY CHỈNH NÂNG CAO CHO BẢNG NGỮ PHÁP === */
/* =============================================================== */

/* --- Định dạng chung cho bảng --- */
.grammar-table {
    width: 100%;
    border-collapse: collapse; /* Gộp các đường viền lại */
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Thêm bóng đổ nhẹ */
    border-radius: 8px; /* Bo góc cho bảng */
    overflow: hidden; /* Đảm bảo bo góc hoạt động */
}

/* --- Định dạng cho tiêu đề bảng (hàng đầu tiên) --- */
.grammar-table th {
    background-color: #34495e; /* Màu xanh đen */
    color: white;
    font-weight: bold;
    padding: 15px;
    text-align: left;
}

/* --- Định dạng chung cho các ô dữ liệu --- */
.grammar-table td {
    padding: 15px;
    border-bottom: 1px solid #ddd; /* Đường kẻ mờ giữa các hàng */
}

/* --- YÊU CẦU 1: MÀU SẮC XEN KẼ CHO CÁC HÀNG --- */
/* Chọn các hàng LẺ (1, 3, 5...) trong phần thân bảng */
.grammar-table tbody tr:nth-child(odd) {
    background-color: #e0f7fa; /* MÀU XANH NGỌC PASTEL */
}

/* Chọn các hàng CHẴN (2, 4, 6...) trong phần thân bảng */
.grammar-table tbody tr:nth-child(even) {
    background-color: #f3e5f5; /* MÀU TÍM PASTEL */
}

/* --- YÊU CẦU 2: HIỆU ỨNG KHI DI CHUỘT QUA --- */
/* Thêm hiệu ứng chuyển động mượt mà cho màu nền */
.grammar-table tbody tr {
    transition: background-color 0.3s ease;
}

/* Khi con trỏ chuột di chuyển LÊN trên bất kỳ hàng nào */
.grammar-table tbody tr:hover {
    background-color: #fffde7; /* MÀU VÀNG NHẠT */
    cursor: pointer; /* Đổi con trỏ chuột để tạo cảm giác tương tác */
}



