:root {
    --primary-color: #d32f2f; /* Japanese Red */
    --primary-hover: #b71c1c;
    --secondary-color: #424242; /* Dark Grey */
    --secondary-hover: #616161;
    --border-color: #e0e0e0;
    --background-color: #f5f5f5;
    --favorite-color: #ffc107;
}

body {
    background-color: var(--background-color);
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    transition: background-image 0.5s ease-in-out;
}

/* Selection Screen တွေမှာသုံးမယ့် နောက်ခံပုံ */
/* Selection Screen တွေမှာသုံးမယ့် နောက်ခံပုံ */
body.selection-view {
    background-image: url('images/background2.JPG'); /* <<< ဒီစာကြောင်းကို ပြောင်းလိုက်ပါ */
    background-size: cover; /* ပုံကို screen အပြည့်ဖြစ်အောင် ချိန်ညှိရန် */
    background-position: center; /* ပုံကို အလယ်တည့်တည့်မှာထားရန် */
}

.container {
    background-color: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease-in-out;
}

body.selection-view .container {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1, h2 { text-align: center; color: #333; }
p.description { text-align: center; color: #777; margin-bottom: 30px; }
.screen { display: none; width: 100%; animation: fadeIn 0.4s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

button { font-family: 'Noto Sans JP', sans-serif; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
button.primary { background-color: var(--primary-color); color: white; }
button.primary:hover { background-color: var(--primary-hover); }

.screen-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.back-btn { background-color: transparent; color: var(--secondary-color); font-size: 0.9rem; padding: 8px 15px; }
.back-btn:hover { background-color: #f0f0f0; }

#chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; max-height: 400px; overflow-y: auto; padding: 5px; }
.chapter-btn { background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; text-align: left; }
.chapter-btn:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,0.08); border-color: var(--primary-color); }
body.selection-view .chapter-btn { background-color: rgba(255, 255, 255, 0.7); border-color: rgba(255, 255, 255, 0.3); }
.chapter-btn h3 { margin: 0; font-size: 1.1rem; color: #333; }
.chapter-btn p { margin: 5px 0 10px 0; font-size: 0.8rem; color: #888; }
.progress-bar-container { background-color: #e0e0e0; border-radius: 10px; height: 8px; overflow: hidden; }
.progress-bar { background-color: var(--primary-color); height: 100%; width: 0%; border-radius: 10px; transition: width 0.5s ease; }
.chapter-btn.favorites { border-color: var(--favorite-color); }
.chapter-btn.favorites h3 { color: var(--favorite-color); }

.mode-buttons { display: grid; grid-template-columns: 1fr; gap: 15px; }
.mode-btn { background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; transition: all 0.2s ease; text-align: left; display: flex; align-items: center; gap: 20px; }
.mode-btn:hover { border-color: var(--primary-color); background-color: #fff8f8; }
body.selection-view .mode-btn { background-color: rgba(255, 255, 255, 0.7); border-color: rgba(255, 255, 255, 0.3); }
.mode-icon { font-size: 2.5rem; }
.mode-btn h3 { margin: 0 0 5px 0; color: var(--primary-color); font-size: 1.2rem; }
.mode-btn p { margin: 0; color: #666; font-size: 0.9rem;}

#study-card { background-color: #fff; border-radius: 8px; padding: 30px; min-height: 300px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--border-color); }
.study-header { display: flex; justify-content: space-between; align-items: flex-start; }
#study-word { font-size: 2.8rem; font-weight: bold; color: #333; margin-bottom: 15px; flex-grow: 1; }
#study-card hr { border: none; border-top: 1px solid #eee; width: 100%; margin: 0 auto 15px auto; }
#study-meaning { font-size: 1.5rem; color: #555; }
#study-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
#study-nav button { background-color: var(--secondary-color); color: white; padding: 10px 20px; }
#study-nav button:disabled { background-color: #ccc; cursor: not-allowed; }
#study-counter { font-size: 1.1rem; color: #888; }
.favorite-btn { background: none; border: none; font-size: 2rem; cursor: pointer; color: #ccc; transition: color 0.2s, transform 0.2s; padding: 0; }
.favorite-btn:hover { transform: scale(1.2); }
.favorite-btn.favorited { color: var(--favorite-color); }

#toggle-kanji-only-btn { background-color: #f0f0f0; border: 1px solid #ddd; color: #555; font-size: 0.9rem; padding: 8px 15px; border-radius: 20px; }
#toggle-kanji-only-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.flashcard-container { perspective: 1000px; min-height: 300px; margin-bottom: 30px; }
#flashcard { width: 100%; height: 300px; position: relative; transition: transform 0.6s; transform-style: preserve-3d; }
#flashcard.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 12px; box-sizing: border-box; background-color: #fff; border: 1px solid var(--border-color); box-shadow: 0 4px 10px rgba(0,0,0,0.05); padding: 20px; }
.card-back { transform: rotateY(180deg); background-color: #fdf8f8; }
.card-front #favorite-btn-practice { position: absolute; top: 15px; right: 15px; }
#practice-word { font-size: 3.5rem; font-weight: bold; color: #333; }
#practice-meaning { font-size: 2rem; color: var(--primary-color); }
.button-group { display: flex; justify-content: center; gap: 15px; }
.button-group button { background-color: var(--secondary-color); color: white; padding: 15px 30px; font-size: 1.2rem; }
.button-group button:hover { background-color: var(--secondary-hover); }
.button-group button.primary:hover { background-color: var(--primary-hover); }

#input-prompt-meaning { background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 40px 20px; min-height: 150px; display: flex; justify-content: center; align-items: center; font-size: 1.8rem; color: #333; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.input-area { display: flex; gap: 10px; }
#user-input-field { flex-grow: 1; border: 2px solid #ddd; border-radius: 8px; padding: 15px; font-size: 1.2rem; }
#user-input-field:focus { border-color: var(--primary-color); outline: none; }
#submit-answer-btn { padding: 15px 25px; font-size: 1.1rem; }
#feedback-container { min-height: 80px; margin-top: 20px; font-size: 1.2rem; font-weight: bold; }
#feedback-container.correct { color: var(--correct-color); }
#feedback-container.incorrect { color: var(--incorrect-color); }

#score-display { text-align: center; font-size: 2rem; font-weight: bold; margin-bottom: 20px; }
#score-display .percent { font-size: 3rem; color: var(--primary-color); }
#sakura-rating { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; }
.sakura-blossom { font-size: 2.5rem; color: #e0e0e0; }
.sakura-blossom.earned { color: #ff85a2; animation: popIn 0.5s ease forwards; transform: scale(0); }
.sakura-blossom.earned:nth-child(2) { animation-delay: 0.2s; }
.sakura-blossom.earned:nth-child(3) { animation-delay: 0.4s; }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
#results-summary { max-height: 250px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; padding: 10px; text-align: left; }
.result-item { padding: 15px; border-bottom: 1px solid #eee; }
.result-item:last-child { border-bottom: none; }
.result-item.correct { color: var(--correct-color); }
.result-item.incorrect { color: var(--incorrect-color); }
.result-item .word { font-weight: bold; font-size: 1.2rem; }
#restart-input-test-btn { width: 100%; padding: 15px; margin-top: 20px; margin-bottom: 10px; font-size: 1.1rem; }

footer { margin-top: 30px; text-align: center; color: #888; }