/* 전역 스타일 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* 헤더 */
header {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 1rem 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.9;
}

/* 메인 콘텐츠 */
main {
    margin-bottom: 60px;
    min-height: calc(100vh - 300px);
}

section {
    background: var(--white);
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

section:hover {
    transform: translateY(-2px);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

h3 {
    font-size: 1.4rem;
    margin: 30px 0 15px;
    color: #34495e;
}

p {
    margin-bottom: 15px;
    font-size: 1.05rem;
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 12px;
}

/* 학습 카드 그리드 */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.lesson-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.lesson-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.lesson-card h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

.lesson-card p {
    color: #666;
    margin-bottom: 0;
}

/* 예문 스타일 */
.example {
    background: #eff6ff;
    padding: 25px;
    border-left: 5px solid var(--primary-color);
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    font-size: 1.1rem;
}

.example strong {
    color: var(--secondary-color);
}

.example-ko {
    color: #7f8c8d;
    font-size: 1rem;
    margin-top: 8px;
    font-style: normal;
}

/* 구조 다이어그램 스타일 */
.structure-diagram {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    background: #f1f2f6;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
}

.diagram-box {
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    border: 2px solid var(--secondary-color);
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.diagram-plus {
    font-size: 1.5rem;
    color: #95a5a6;
    font-weight: bold;
}

.diagram-label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
    font-weight: normal;
}

/* 연습 문제 */
.practice-item {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.practice-input {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 1rem;
    width: 150px;
    margin: 0 5px;
    transition: border-color 0.3s;
}

.practice-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.check-answer-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
    transition: background 0.3s;
}

.check-answer-btn:hover {
    background: #34495e;
}

.result-message {
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.95rem;
    min-height: 1.5em;
    /* 공간 확보 */
}

.result-message.correct {
    color: #27ae60;
}

.result-message.wrong {
    color: var(--accent-color);
}

.answer {
    color: #27ae60;
    font-weight: 700;
    margin-top: 15px;
    padding: 10px;
    background: #eafaf1;
    border-radius: 5px;
    display: none;
}

.show-answer {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: background 0.3s;
}

.show-answer:hover {
    background: #2980b9;
}

/* 피드백 섹션 */
.feedback-section {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-top: 60px;
    border: 1px solid #eee;
    box-shadow: var(--shadow);
    text-align: center;
}

.feedback-section h3 {
    margin-top: 0;
    color: var(--secondary-color);
}

.feedback-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 25px 0;
}

.feedback-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.feedback-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feedback-btn.positive:hover,
.feedback-btn.positive.selected {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

.feedback-btn.negative:hover,
.feedback-btn.negative.selected {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: white;
}

.feedback-comment {
    width: 100%;
    max-width: 600px;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    margin: 0 auto 20px;
    display: block;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
}

.feedback-comment:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-feedback {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

.submit-feedback:hover {
    background: #34495e;
    transform: translateY(-2px);
}

.submit-feedback:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.feedback-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feedback-message.success {
    background: #d4edda;
    color: #155724;
}

.feedback-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* 대시보드 스타일 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 500;
}

.page-feedback {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* 푸터 */
footer {
    background: var(--secondary-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0;
    text-align: center;
    margin-top: auto;
}

.admin-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 15px;
    display: inline-block;
    transition: color 0.3s;
}

.admin-link:hover {
    color: white;
}

/* 네비게이션 */
.nav-links {
    margin: 40px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 50px;
    background: #eaf2f8;
    transition: all 0.3s;
}

.nav-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 반응형 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    section {
        padding: 25px;
    }

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

    .feedback-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
}