/* --- STYLES for AhoMogi 2.0.0 - COMPLETE UI --- */

/* --- Part 1: Selector, Icons, and Buttons --- */
#ahoreal-jlpt-selector {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #eef2f5;
    padding: 40px 10px;
    border-radius: 20px;
}
/* ... [Previous Selector Styles] ... */
.level-icons-wrapper { display: flex; flex-direction: column; align-items: center; gap: 30px; margin-bottom: 30px; }
.level-row { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 30px; }
.level-icon { border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; font-weight: 700; transition: all 0.2s ease-in-out; position: relative; box-shadow: 8px 8px 16px #d3d8db, -8px -8px 16px #ffffff; }
.level-icon[data-level-slug="n5"] { background-color: #e0f1ff; color: #006bb3; }
.level-icon[data-level-slug="n4"] { background-color: #e3fcef; color: #007a5a; }
.level-icon[data-level-slug="n3"] { background-color: #fff8e1; color: #b38600; }
.level-icon[data-level-slug="n2"] { background-color: #ffefe6; color: #cc5200; }
.level-icon[data-level-slug="n1"] { background-color: #f3e5f5; color: #6a1b9a; }
.level-row-1 .level-icon { width: 90px; height: 90px; font-size: 24px; }
.level-row-2 .level-icon { width: 120px; height: 120px; font-size: 32px; }
.level-row-3 .level-icon { width: 150px; height: 150px; font-size: 40px; }
.level-icon.active { box-shadow: inset 8px 8px 16px rgba(0,0,0,0.1), inset -8px -8px 16px rgba(255,255,255,0.7); transform: translateY(2px); }
.ahoreal-container { text-align: center; position: relative; overflow: hidden; transition: max-height 0.7s ease-in-out, padding 0.7s ease-in-out, margin 0.7s ease-in-out; max-height: 0; padding: 0 10px; border-radius: 15px; margin: 0; }
.ahoreal-container.open { max-height: 2000px; padding: 30px 10px; margin-top: 20px; background-color: #eef2f5; box-shadow: inset 6px 6px 12px #d3d8db, inset -6px -6px 12px #ffffff; }
.ahoreal-container .container-title { font-size: 1.2em; font-weight: bold; color: #5b6271; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #d3d8db; }
.ahoreal-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s; }
.ahoreal-container.open .ahoreal-list { opacity: 1; transform: translateY(0); }
.ahoreal-button { padding: 10px 15px; border-radius: 10px; text-decoration: none; font-weight: 600; transition: all 0.2s ease-in-out; display: inline-block; text-align: center; border: none; cursor: pointer; color: #333; box-shadow: 4px 4px 8px #d3d8db, -4px -4px 8px #ffffff; background-color: #f0f0f1; }
.ahoreal-button:hover { transform: translateY(-2px); }
.ahoreal-button:active, .ahoreal-button.active { box-shadow: inset 4px 4px 8px #d3d8db, inset -4px -4px 8px #ffffff; transform: translateY(1px); }
.ahoreal-message { font-weight: bold; color: #5b6271; padding: 10px; }
.ahoreal-loader { border: 4px solid #d3d8db; border-top: 4px solid #3d8fcc; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Part 2: Quiz Page Styles --- */
#ahoreal-jlpt-quiz {
    max-width: 800px; margin: 20px auto; padding: 20px; background: #fff; border: 1px solid #ccc; font-family: 'Times New Roman', Times, serif; color: #000;
}
#ahoreal-jlpt-quiz .quiz-title, #ahoreal-jlpt-quiz .quiz-topic h2 {
    font-size: 1.2em; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc; padding-bottom: 15px; margin-bottom: 25px;
}
#ahoreal-jlpt-quiz .quiz-title { font-size: 1.4em; border-bottom-style: double; border-bottom-width: 3px; }

.quiz-topic { display: none; }
.quiz-topic.active { display: block; }

.quiz-question {
    margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px dashed #ccc; position: relative;
}
.quiz-question p {
    font-size: 1em;
    margin-bottom: 15px;
    white-space: pre-line;
    line-height: 1.6;
}

/* Passage */
.quiz-passage {
    background: #fdfdfe;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    white-space: pre-line;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
}

.quiz-question p strong, .quiz-question strong { font-weight: bold !important; }

/* Rich Media */
.quiz-question img, .quiz-lesson-content img, .quiz-explanation img, .quiz-passage img {
    max-width: 100%; height: auto; display: block; margin: 15px auto; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.quiz-question audio, .quiz-lesson-content audio, .quiz-explanation audio, .quiz-passage audio {
    width: 100%; margin: 15px 0; display: block;
}

/* Lesson Content */
.quiz-lesson-content { margin-bottom: 25px; padding: 15px; background-color: #f9f9f9; border-left: 4px solid #3d8fcc; line-height: 1.6; }

/* Quiz Options */
.quiz-options label {
    display: block; margin-bottom: 10px; cursor: pointer; font-size: 1em; padding: 8px 10px; border-radius: 6px; transition: all 0.2s; border: 1px solid transparent;
}
.quiz-options label:hover { background-color: #f0f0f1; }
.quiz-options input { margin-right: 10px; }

/* Navigation Buttons */
#quiz-navigation { text-align: center; margin-top: 30px; display: flex; justify-content: space-between; align-items: center; }
#quiz-navigation button { padding: 10px 20px; font-size: 16px; cursor: pointer; background-color: #0073aa; color: white; border: none; border-radius: 4px; }
#quiz-navigation button:hover { background-color: #005177; }
#quiz-navigation button:disabled { background-color: #ccc; cursor: not-allowed; }

/* Quiz Results & Feedback */
.quiz-results-view .quiz-question { border-bottom: 1px solid #ccc; }

.quiz-options .result-correct {
    background-color: #e8f7ee;
    color: #155724;
    border: 1px solid #b7e4c7;
}
.quiz-options .result-incorrect {
    background-color: #fdecef;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.quiz-options .user-choice::before { content: ''; }

.answer-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    line-height: 1;
}
.result-correct .answer-status-icon { background: #198754; color: #fff !important; }
.result-incorrect .answer-status-icon { background: #dc3545; color: #fff !important; }

/* Unanswered warning */
.unanswered-warning {
    color: #dc3545;
    font-weight: 700;
    margin-top: 8px;
    font-size: 0.95em;
    animation: ahorealPulse 1s ease-in-out 2;
}
@keyframes ahorealPulse {
    0% { opacity: 0.35; transform: translateY(1px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Explanation */
.quiz-explanation {
    margin-top: 15px;
    padding: 15px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-left: 4px solid #0073aa;
    font-size: 0.95em;
    line-height: 1.7;
    white-space: normal;
    word-break: break-word;
}
.quiz-explanation p {
    margin: 0 0 0.65em 0;
    line-height: 1.7;
}
.quiz-explanation p:last-child {
    margin-bottom: 0;
}
.quiz-explanation br {
    line-height: 1.7;
}
.quiz-explanation ul,
.quiz-explanation ol {
    margin: 0.5em 0 0.8em 1.2em;
}
.quiz-explanation li {
    margin-bottom: 0.35em;
}

#quiz-score-summary { margin-top: 20px; border-collapse: collapse; width: 100%; }
#quiz-score-summary th, #quiz-score-summary td { border: 1px solid #000; padding: 8px; text-align: left; }
#quiz-score-summary th { background-color: #f2f2f2; }
#redo-quiz-btn { display: block; margin: 0 auto; padding: 12px 30px; font-size: 18px; font-weight: bold; cursor: pointer; border: none; border-radius: 5px; background-color: #0073aa; color: white; }
#redo-quiz-btn:hover { background-color: #005a87; }
.feedback-icon { background: none; border: none; cursor: pointer; font-size: 18px; position: absolute; top: -5px; right: 0; opacity: 0.6; padding: 5px; }
.feedback-icon:hover { opacity: 1; }

#quiz-results-navigation { text-align: center; margin-top: 30px; }
#cross-year-next-btn { background-color: #28a745; color: white; border: none; padding: 10px 30px; font-size: 18px; cursor: pointer; border-radius: 5px; margin-left: 10px; }
#cross-year-next-btn:hover { background-color: #218838; }

/* Leaderboard */
.ahoreal-login-prompt { padding: 15px; background-color: #fff3cd; border: 1px solid #ffeeba; border-radius: 4px; margin: 20px auto; max-width: 800px; text-align: center; }
.ahoreal-login-prompt span { margin-right: 15px; font-weight: bold; color: #856404; }
.ahoreal-login-button { display: inline-block; padding: 8px 16px; background-color: #007bff; color: #fff !important; text-decoration: none; border-radius: 4px; font-weight: bold; }
.quiz-topic-leaderboard { max-width: 800px; margin: 20px auto; padding: 20px; background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; }
.leaderboard-table-wrapper { overflow-x: auto; }
.quiz-topic-leaderboard h3 { text-align: center; margin: 0 0 20px 0; font-size: 1.5em; color: #343a40; }
.ahoreal-leaderboard-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.ahoreal-leaderboard-table th, .ahoreal-leaderboard-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #dee2e6; vertical-align: middle; white-space: nowrap; }
.ahoreal-leaderboard-table th { background-color: #e9ecef; font-weight: bold; }
.ahoreal-leaderboard-table tr.top-1 { background-color: #fce1d4; font-weight: bold; }
.ahoreal-leaderboard-table tr.top-2 { background-color: #fff3cd; font-weight: bold; }
.ahoreal-leaderboard-table tr.top-3 { background-color: #d4edda; font-weight: bold; }
.leaderboard-medal { font-size: 1.2em; margin-right: 5px; }
.leaderboard-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.leaderboard-name-cell { display: flex; align-items: center; }

/* Schedule Gate / Countdown */
.ahoreal-schedule-gate {
    max-width: 980px;
    margin: 30px auto;
    padding: 20px;
}
.ahoreal-schedule-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 50%, #7c3aed 100%);
    color: #fff;
    border-radius: 24px;
    padding: 38px 24px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(37, 99, 235, 0.28);
}
.ahoreal-schedule-card::before,
.ahoreal-schedule-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.28;
    pointer-events: none;
}
.ahoreal-schedule-card::before {
    width: 220px;
    height: 220px;
    background: #60a5fa;
    top: -60px;
    left: -40px;
}
.ahoreal-schedule-card::after {
    width: 260px;
    height: 260px;
    background: #c084fc;
    bottom: -90px;
    right: -60px;
}
.ahoreal-schedule-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.22);
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
    backdrop-filter: blur(6px);
}
.ahoreal-schedule-title {
    margin: 0 0 10px 0 !important;
    font-size: 2rem;
    line-height: 1.25;
    color: #fff !important;
}
.ahoreal-schedule-subtitle {
    max-width: 720px;
    margin: 0 auto 26px auto;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.92);
}
.ahoreal-countdown-wrap {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 16px;
    max-width: 760px;
    margin: 0 auto 24px auto;
}
.ahoreal-countdown-box {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 18px;
    padding: 18px 12px;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.ahoreal-countdown-box .num {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.ahoreal-countdown-box .label {
    display: block;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.82);
}
.ahoreal-schedule-note {
    margin: 8px auto 20px auto;
    font-size: 1.08rem;
    font-weight: 700;
    color: #fef3c7;
}
.ahoreal-schedule-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.ahoreal-schedule-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 12px 22px;
    border-radius: 999px;
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.25s ease;
}
.ahoreal-schedule-btn.register {
    background: #facc15;
    color: #111827 !important;
    box-shadow: 0 8px 20px rgba(250, 204, 21, 0.35);
}
.ahoreal-schedule-btn.login {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff !important;
}
.ahoreal-schedule-btn:hover {
    transform: translateY(-2px);
    opacity: 0.96;
}
.ahoreal-schedule-time {
    font-size: 0.98rem;
    color: rgba(255,255,255,0.88);
}

@media (max-width: 767px) {
    .ahoreal-schedule-card {
        padding: 28px 16px;
        border-radius: 20px;
    }
    .ahoreal-schedule-title {
        font-size: 1.55rem;
    }
    .ahoreal-countdown-wrap {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 12px;
    }
    .ahoreal-countdown-box .num {
        font-size: 1.85rem;
    }
}

@media print { body * { display: none !important; visibility: hidden !important; } }