/* 1. 기본 설정 및 변수 */
:root {
    --primary-color: #4A90E2; /* 파랑 */
    --bg-color: #F4F7F6;
    --text-color: #333;
    
    /* 교시별 포인트 색상 */
    --story-color: #FF8C00;   /* 1교시 주황 */
    --study-color: #4CAF50;   /* 2교시 초록 */
    --play-color: #E91E63;    /* 3교시 분홍 */
    
    /* 카드 배경색 (파스텔톤) */
    --story-bg: #FFE0B2;
    --study-bg: #C8E6C9;
    --play-bg: #F8BBD0;
}

body {
    margin: 0; padding: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-y: scroll; 
}

/* 2. 메인 화면 (index.html) 공통 */
.container {
    display: flex;
    width: 90%; max-width: 1000px; height: 600px;
    background: white; border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    overflow: hidden; margin: 100px auto; 
}

.section {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 40px; text-align: center;
    transition: all 0.4s ease; cursor: pointer;
}

.section-korean {
    background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
    border-right: 1px solid #eee;
}
.section-korean:hover { background: #e3f2fd; flex: 1.2; }
.section-korean h2 { color: var(--primary-color); }

.section-ece { background: #f8f9fa; color: #888; }
.section-ece:hover { background: #ecf0f1; color: #555; }

.lock-icon { font-size: 3rem; margin-bottom: 15px; color: #ccc; }
.btn {
    margin-top: 20px; padding: 10px 25px;
    border-radius: 25px; border: none; font-weight: bold;
    cursor: pointer; transition: transform 0.2s;
}
.btn-korean { background-color: var(--primary-color); color: white; }
.btn-ece { background-color: #ccc; color: white; }
.section:hover .btn { transform: scale(1.05); }
.footer { text-align: center; padding: 20px; font-size: 0.8rem; color: #aaa; }


/* 3. 상단 네비게이션 바 */
.navbar {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 60px;
    background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex; align-items: center; padding: 0 20px;
    z-index: 100; box-sizing: border-box;
}
.back-link { text-decoration: none; color: #333; font-weight: bold; margin-right: 20px; }
.nav-title { font-weight: 700; color: var(--primary-color); }


/* 4. 한국어 자료실 (korean.html) 상세 디자인 */
.category-header {
    width: 90%; max-width: 1000px;
    margin: 50px auto 20px auto;
    border-bottom: 2px dashed #ddd; padding-bottom: 10px;
}
.first-header { margin-top: 100px; } /* 첫번째 요소 여백 */

.category-title {
    font-family: 'Jua', sans-serif; font-size: 1.8rem;
    color: #555; display: flex; align-items: center; gap: 10px;
}
.category-desc { color: #888; margin-top: 5px; font-size: 0.95rem; }

/* 텍스트 색상 헬퍼 클래스 */
.text-story { color: var(--story-color); }
.text-study { color: var(--study-color); }
.text-play { color: var(--play-color); }

/* 갤러리 그리드 */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 90%; max-width: 1000px;
    margin: 10px auto 30px auto;
}
.last-container { padding-bottom: 100px; } /* 마지막 요소 여백 */

.card {
    background: white; border-radius: 15px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer; transition: transform 0.2s; border: 1px solid #eee;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.card-image {
    height: 150px; display: flex;
    justify-content: center; align-items: center;
    font-size: 4rem; color: white;
}
/* 카드 배경색 헬퍼 클래스 */
.bg-story { background-color: var(--story-bg); }
.bg-study { background-color: var(--study-bg); }
.bg-play { background-color: var(--play-bg); }

.card-content { padding: 20px; }
.card h3 { margin: 0 0 10px 0; font-size: 1.2rem; color: #333; }
.card p { font-size: 0.9rem; color: #666; margin-bottom: 15px; line-height: 1.5; }
.tag {
    background-color: #f0f4f8; color: #555;
    padding: 5px 10px; border-radius: 10px;
    font-size: 0.8rem; font-weight: bold;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .container { flex-direction: column; height: auto; margin: 20px auto; }
    .section { padding: 60px 20px; }
    .section-korean { border-right: none; border-bottom: 1px solid #eee; }
    .gallery-container { grid-template-columns: 1fr; }
}

/* --- 웹사이트 느낌을 살려주는 UX 디테일 추가 --- */

/* 1. 모든 클릭 가능한 요소에 부드러운 반응 추가 */
button, .card, .side-links a, .start-btn {
    transition: all 0.3s ease; /* 모든 변화를 0.3초 동안 부드럽게 */
    cursor: pointer;
}

/* 2. 클릭했을 때 살짝 눌리는 느낌 (피드백) */
button:active, .card:active, .start-btn:active {
    transform: scale(0.96); /* 아주 살짝 작아짐 */
}

/* 3. 예쁜 커스텀 스크롤바 디자인 (브라우저 우측 바) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; /* 바깥 트랙 색상 */
}
::-webkit-scrollbar-thumb {
    background: #4A90E2; /* 스크롤 막대 색상 */
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}
::-webkit-scrollbar-thumb:hover {
    background: #357ABD; /* 마우스 올렸을 때 더 진하게 */
}

/* 4. 텍스트 드래그 색상 (선생님 브랜드 컬러로) */
::selection {
    background: #4A90E2;
    color: white;
}
/* --- Mobile Responsive (모바일 대응) --- */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .sidebar { 
        width: 100%; height: auto; position: relative; 
        padding: 15px; border-right: none; border-bottom: 1px solid #eee;
    }
    .side-links { flex-direction: row; overflow-x: auto; gap: 10px; padding-bottom: 5px; }
    .side-links a { white-space: nowrap; padding: 10px 15px; font-size: 0.9rem; margin-bottom: 0; }
    .main-content { margin-left: 0; padding: 20px; }
    
    .hero-name { font-size: 3.5rem; }
    .intro-cards { flex-direction: column; }
    .filter-container { flex-direction: column; }
}
/* 사이드바 내 로고와 텍스트 정렬 */
.side-logo {
    display: flex;
    align-items: center;
    padding-left: 5px; /* 왼쪽 여백 살짝 추가 */
}

.side-logo img {
    flex-shrink: 0; /* 로고가 찌그러지지 않게 방지 */
}

/* 사이드바 배경을 흰색으로 통일하여 로고 배경과 일치시킴 */
.sidebar {
    background-color: #ffffff !important;
}
/* 세련된 커스텀 스크롤바 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #4A90E2; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #357ABD; }

/* 카드 눌림 효과 */
.intro-card:active {
    transform: scale(0.98);
}