/* ========================================
   QuirkyQuiz - 파스텔 연두색 테마
   ======================================== */

:root {
    --primary: #a8e6cf;
    --primary-dark: #7bc9a6;
    --primary-light: #c5f0dc;
    --secondary: #ffd3b6;
    --accent: #ffaaa5;
    --accent-alt: #d5aaff;
    --bg: #f8fdf9;
    --bg-card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --success: #00b894;
    --error: #ff6b6b;
    --border: #e8f5e9;
    --shadow: 0 2px 12px rgba(168, 230, 207, 0.15);
    --shadow-hover: 0 8px 24px rgba(168, 230, 207, 0.25);
    --radius: 16px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}

.user-level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.level-badge.beginner {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.level-badge.intermediate {
    background: var(--secondary);
    color: #e17055;
}

.level-badge.advanced {
    background: var(--accent-alt);
    color: #6c5ce7;
}

.level-stats {
    font-size: 13px;
    color: var(--text-light);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    padding: 48px 0;
    text-align: center;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.hero p {
    font-size: 16px;
    color: var(--text-light);
}

/* ========================================
   Categories
   ======================================== */
.categories {
    padding: 24px 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.category-tab {
    padding: 10px 20px;
    border: none;
    background: var(--bg);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-tab:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.category-tab.active {
    background: var(--primary);
    color: var(--text);
}

/* ========================================
   Quiz Grid
   ======================================== */
.quiz-grid {
    padding: 32px 0;
}

.quizzes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.quiz-card-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quiz-card-header.has-image {
    padding: 0;
}

.quiz-card-header.history { background: linear-gradient(135deg, #ffe8d6 0%, #ffd3b6 100%); }
.quiz-card-header.geography { background: linear-gradient(135deg, #e8f5e9 0%, #dcedc1 100%); }
.quiz-card-header.culture { background: linear-gradient(135deg, #ffe5e5 0%, #ffaaa5 100%); }
.quiz-card-header.sports { background: linear-gradient(135deg, #ede7f6 0%, #d5aaff 100%); }

.quiz-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.quiz-card:hover .quiz-card-image {
    transform: scale(1.05);
}

.quiz-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.quiz-card-header.has-image .quiz-card-overlay {
    display: flex;
    align-items: flex-end;
    min-height: 60px;
}

.quiz-card-header:not(.has-image) .quiz-card-overlay {
    position: static;
    background: none;
    padding: 0;
}

.quiz-card-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.quiz-card-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.quiz-card-header.has-image .quiz-card-question {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.quiz-card-body {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-card-category {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.quiz-card-level {
    display: flex;
    gap: 4px;
}

.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.level-dot.active {
    background: var(--primary);
}

.level-dot.active.intermediate {
    background: var(--secondary);
}

.level-dot.active.advanced {
    background: var(--accent-alt);
}

/* ========================================
   Quiz Page
   ======================================== */
.quiz-page {
    padding: 32px 0;
}

.quiz-progress {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.category-badge, .difficulty-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.category-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.difficulty-badge {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.quiz-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.question-text {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* OX Quiz */
.ox-quiz {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.ox-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid;
    font-size: 48px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.o-btn {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.o-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.x-btn {
    background: #ffe5e5;
    border-color: var(--accent);
    color: #e55050;
}

.x-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

/* Multiple Choice */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    padding: 16px 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Text Input */
.text-quiz {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.text-input {
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 18px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.text-input:focus {
    border-color: var(--primary);
}

.submit-btn {
    padding: 16px 32px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

/* Result Screen */
.quiz-result-screen {
    text-align: center;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 16px;
}

.result-text {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.result-text.correct {
    color: var(--success);
}

.result-text.wrong {
    color: var(--error);
}

.correct-answer {
    background: var(--bg);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 18px;
}

.correct-answer .label {
    color: var(--text-light);
    margin-right: 8px;
}

.correct-answer .answer {
    font-weight: 600;
    color: var(--primary-dark);
}

.explanation {
    background: var(--primary-light);
    padding: 24px;
    border-radius: var(--radius-sm);
    text-align: left;
    margin-bottom: 32px;
}

.explanation h3 {
    font-size: 16px;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.explanation p {
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn {
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--text);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 24px;
    }

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

    .quiz-container {
        padding: 24px;
    }

    .question-text {
        font-size: 20px;
    }

    .ox-btn {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-card {
    animation: fadeIn 0.3s ease;
}

.quiz-result-screen {
    animation: fadeIn 0.4s ease;
}
