/* 퀴즈 앱 전용 스타일 - qm- 접두사 사용 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
}

.qm-container {
    max-width: 720px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 2rem);
}

/* 헤더 스타일 */
.qm-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 2rem;
    text-align: center;
}

.qm-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.qm-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 메인 콘텐츠 */
.qm-main {
    padding: 2rem;
}

/* 과목 선택 카드 */
.qm-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.qm-subject-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: #334155;
    transition: all 0.3s ease;
    cursor: pointer;
}

.qm-subject-card:hover {
    border-color: #4f46e5;
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
    text-decoration: none;
    color: #4f46e5;
}

.qm-subject-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.qm-subject-desc {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* 퀴즈 영역 */
.qm-quiz-header {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid #4f46e5;
}

.qm-quiz-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.qm-quiz-info {
    color: #64748b;
    font-size: 0.9rem;
}

.qm-question-box {
    background: #fefefe;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.qm-question-number {
    background: #4f46e5;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.qm-question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.qm-answer-box {
    background: #f0fdf4;
    border: 2px solid #16a34a;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    display: none;
}

.qm-answer-text {
    font-size: 1rem;
    color: #15803d;
    font-weight: 500;
}

/* 버튼 스타일 */
.qm-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.qm-btn-primary {
    background: #4f46e5;
    color: white;
}

.qm-btn-primary:hover {
    background: #4338ca;
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.qm-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.qm-btn-secondary:hover {
    background: #e2e8f0;
    text-decoration: none;
    color: #334155;
}

.qm-btn-success {
    background: #16a34a;
    color: white;
}

.qm-btn-success:hover {
    background: #15803d;
    text-decoration: none;
    color: white;
}

/* 버튼 그룹 */
.qm-btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.qm-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

/* 푸터 */
.qm-footer {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.qm-footer-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.qm-footer-link:hover {
    text-decoration: underline;
}

/* 에러/안내 메시지 */
.qm-alert {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

.qm-alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.qm-alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

/* 반응형 */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .qm-container {
        min-height: calc(100vh - 1rem);
        border-radius: 12px;
    }
    
    .qm-header {
        padding: 1.5rem;
    }
    
    .qm-title {
        font-size: 1.5rem;
    }
    
    .qm-main {
        padding: 1.5rem;
    }
    
    .qm-subjects {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .qm-subject-card {
        padding: 1.25rem;
    }
    
    .qm-question-box {
        padding: 1.5rem;
    }
    
    .qm-navigation {
        flex-direction: column;
        text-align: center;
    }
    
    .qm-btn-group {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .qm-header {
        padding: 1rem;
    }
    
    .qm-title {
        font-size: 1.25rem;
    }
    
    .qm-main {
        padding: 1rem;
    }
    
    .qm-question-box {
        padding: 1rem;
    }
    
    .qm-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }
}
