/* --- English Quiz Hub - Modern UI Style --- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --bg: #f7f8fb;
    --card: #ffffff;
    --text: #1f2937;
    --sub: #6b7280;
    --line: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --soft: #eff6ff;
    --soft-2: #f8fafc;
    --success: #166534;
    --success-bg: #ecfdf5;
    --error: #b91c1c;
    --error-bg: #fef2f2;
    --shadow: 0 10px 30px rgba(15,23,42,0.06);
    --radius: 20px;
    
    /* Legacy variables for compatibility during transition */
    --bg-color: var(--bg);
    --card-bg: var(--card);
    --primary-hover: var(--primary-dark);
    --secondary: var(--sub);
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --text-main: var(--text);
    --border: var(--line);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    word-break: keep-all;
}

a {
    color: var(--primary);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

/* Header & Nav */
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
}

.menu a {
    color: var(--sub);
    font-size: 14px;
    transition: color 0.2s;
}

.menu a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 60px 0 30px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: stretch;
}

.hero-card {
    padding: 38px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card h1 {
    margin: 0 0 16px;
    font-size: 42px;
    line-height: 1.2;
    font-weight: 800;
}

.hero-card p {
    margin: 0 0 20px;
    color: var(--sub);
    font-size: 17px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.side-stack {
    display: grid;
    gap: 16px;
}

.side-card {
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.side-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
}

.side-card p {
    margin: 0;
    color: var(--sub);
    font-size: 15px;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
    background: var(--soft);
    border: 1px solid #bfdbfe;
    margin-bottom: 10px;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--line);
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}

/* Section Head */
.section-head {
    margin-bottom: 18px;
    text-align: center;
}

.section-head h2 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 800;
}

.section-head p {
    margin: 0;
    color: var(--sub);
}

/* Quiz Layout */
.quiz-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    margin-bottom: 40px;
}

.quiz-card {
    padding: 28px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--line);
    font-size: 13px;
    color: var(--sub);
    font-weight: 700;
}

.question-box {
    background: var(--soft-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 18px;
    text-align: center;
}

.question-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.target-word-display {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.phonetic-display {
    color: var(--sub);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 15px;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
}

.option-btn {
    width: 100%;
    text-align: center;
    border: 2px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: all .15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.option-btn:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #f8fbff;
    transform: translateY(-2px);
}

.option-btn.correct {
    background-color: #2ecc71 !important;
    border-color: #2ecc71 !important;
    color: white !important;
}

.option-btn.wrong {
    background-color: #e74c3c !important;
    border-color: #e74c3c !important;
    color: white !important;
}

.status-box {
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--sub);
    margin: 16px 0 0;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.status-box.success {
    background: var(--success-bg);
    border-color: #bbf7d0;
    color: var(--success);
}

.status-box.error {
    background: var(--error-bg);
    border-color: #fecaca;
    color: var(--error);
}

.quiz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

/* Note Card (Wrong Answer Notebook) */
.note-card {
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.note-card h3 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
}

.note-card p {
    color: var(--sub);
    margin: 0 0 14px;
    font-size: 15px;
}

.empty-note-text {
    background: #fafafa;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 20px;
    color: var(--sub);
    text-align: center;
    font-size: 0.95rem;
}

.wrong-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.wrong-item {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    transition: border-color 0.2s;
}

.wrong-item:hover {
    border-color: var(--primary);
}

.wrong-item strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
    color: var(--error);
}

.wrong-item span {
    color: var(--sub);
    font-size: 0.9rem;
}

/* Guide Grid */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 18px;
}

.section-card {
    display: block;
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all .15s ease;
    text-decoration: none;
}

.section-card:hover {
    transform: translateY(-4px);
    border-color: #c7d2fe;
    box-shadow: 0 15px 35px rgba(15,23,42,0.1);
}

.section-card h3 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.35;
    color: var(--text);
    font-weight: 700;
}

.section-card p {
    margin: 0 0 14px;
    color: var(--sub);
    font-size: 14px;
}

.link-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}

/* Steps Section */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.info-card {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--soft);
    border: 1px solid #bfdbfe;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.info-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.info-card p {
    margin: 0;
    color: var(--sub);
    font-size: 15px;
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    gap: 14px;
}

.faq-card {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.faq-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.faq-card p {
    margin: 0;
    color: var(--sub);
    font-size: 15px;
}

/* About Summary */
.about-summary {
    padding: 38px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.about-summary h2 {
    margin: 0 0 12px;
    font-size: 30px;
    font-weight: 800;
}

.about-summary p {
    margin: 0 0 20px;
    color: var(--sub);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 25px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

/* Toast Notification */
#toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 14px 28px;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 600;
    display: none;
    z-index: 2000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    margin-top: 40px;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 40px 0;
    color: var(--sub);
    font-size: 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 15px;
    justify-content: center;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

/* Animations */
@keyframes success-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fail-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.correct-anim {
    animation: success-bounce 0.5s ease;
}

.wrong-anim {
    animation: fail-shake 0.4s ease;
}

.fade-in {
    animation: fade-in-anim 0.5s ease-out;
}

@keyframes fade-in-anim {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
    .hero-grid,
    .quiz-layout,
    .guide-grid,
    .steps {
        grid-template-columns: 1fr 1fr;
    }

    .guide-grid .section-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .nav {
        align-items: center;
        flex-direction: column;
        gap: 15px;
    }

    .menu {
        justify-content: center;
    }

    .hero-grid,
    .quiz-layout,
    .guide-grid,
    .steps {
        grid-template-columns: 1fr;
    }

    .guide-grid .section-card:last-child {
        grid-column: auto;
    }

    .hero-card {
        padding: 32px 24px;
    }

    .hero-card h1 {
        font-size: 32px;
    }

    .target-word-display {
        font-size: 2.8rem;
    }

    .options {
        grid-template-columns: 1fr;
    }
}
