:root {
    --primary-color: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #4834d4;
    --bg-color: #dfe6e9;
    --card-bg: #ffffff;
    --text-color: #2d3436;
    --text-secondary: #636e72;
    --success-color: #00b894;
    --error-color: #d63031;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: #eef2f5; /* Light bluish grey background */
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); /* Soft purple-blue gradient */
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 480px; /* Mobile-first view */
    background-color: rgba(255, 255, 255, 0.9);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* Header */
.main-header {
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.main-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.main-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Content */
.content-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Progress Bar */
.progress-container {
    height: 8px;
    background-color: #f1f2f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: right;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

/* Footer */
.main-footer {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
}

.icon-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.icon-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.icon-btn .label {
    font-size: 0.7rem;
}

/* Modal */
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#modal-title {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

#modal-body {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.5;
    text-align: left;
}

/* Quiz Styles */
.quiz-container {
    text-align: center;
    padding: 1rem 0;
}

.quiz-question {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-options {
    display: grid;
    gap: 1rem;
}

.quiz-option {
    background: white;
    border: 2px solid #eee;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.quiz-option:hover {
    border-color: var(--primary-light);
    background-color: #f8f9fa;
}

.quiz-option.correct {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.quiz-option.incorrect {
    background-color: #fee2e2;
    border-color: var(--error-color);
    color: #991b1b;
}

/* Explanation Box */
.explanation-box {
    background-color: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-top: 1rem;
    text-align: left;
    border-radius: 4px;
}

.explanation-box h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.explanation-box p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.back-btn {
    margin-bottom: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.back-btn:hover {
    color: var(--primary-color);
}
