/* Google Fonts: style.css @import 제거 - index.html의 preconnect link 방식으로 이전됨 */
/* 시스템 폰트 fallback - 폰트 없이도 레이아웃 보장 */

:root {
    --mint-primary: #55b346;
    --mint-dark: #45963a;
    --mint-light: #f4faf0;
    --mint-pale: #e6f2e0;
    --accent-orange: #ff9d76;
    --accent-yellow: #ffec3d;
    --bg-main: #f9fdf8;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --white: #ffffff;
    --shadow-soft: 0 10px 30px rgba(85, 179, 70, 0.1);
    --shadow-medium: 0 15px 45px rgba(85, 179, 70, 0.15);
}

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Premium Card Container (Tablet Look) */
.premium-card {
    background: var(--white);
    border-radius: 50px;
    box-shadow: var(--shadow-medium);
    width: 95%;
    max-width: 1200px;
    height: 750px;
    padding: 0;
    position: relative;
    border: 12px solid var(--white);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#main-container {
    position: relative;
}

.view-section {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

/* Stitched Border Effect */
.stitched {
    position: relative;
    border: 3px solid var(--mint-primary);
    border-radius: 30px;
    padding: 20px;
}

.stitched::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px dashed rgba(70, 179, 165, 0.4);
    border-radius: 26px;
    pointer-events: none;
}

/* Buttons */
.btn-primary {
    background: var(--mint-primary);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(70, 179, 165, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: var(--mint-dark);
    box-shadow: 0 12px 25px rgba(70, 179, 165, 0.3);
}

.btn-start {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-yellow);
    color: #4a4a4a;
    padding: 20px 80px;
    border-radius: 100px;
    font-size: 2rem;
    font-weight: 900;
    border: 6px solid #fff;
    box-shadow: 0 15px 35px rgba(255, 236, 61, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10; /* 로고보다 위로 */
}

.btn-start:hover {
    transform: translateX(-50%) scale(1.1) rotate(-2deg);
    box-shadow: 0 20px 45px rgba(255, 236, 61, 0.6);
}

.btn-outline {
    border: 2.5px solid var(--mint-primary);
    color: var(--mint-primary);
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-tab {
    width: 70px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    border-radius: 0 25px 25px 0;
    font-weight: 800;
    font-size: 1.1rem;
    transition: all 0.3s ease; /* 심플한 효과로 변경 */
    background: #f9f9f9;
    color: #777;
    border: 3px solid #fff;
    border-left: none !important;
    cursor: pointer;
    box-shadow: 5px 0 10px rgba(0,0,0,0.05);
}

.nav-tab.active {
    background: var(--mint-primary);
    color: #fff;
    box-shadow: 8px 0 15px rgba(85, 179, 70, 0.2);
    transform: translateX(10px); /* 아주 살짝만 튀어나오게 조정 */
}

.btn-outline:hover {
    background: var(--mint-primary);
    color: var(--white);
}

/* Section Transitions */
.view-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.mute-control-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--accent-yellow);
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 236, 61, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
}

.mute-control-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 15px 30px rgba(255, 236, 61, 0.6);
}

.mute-control-btn.playing {
    background: #b7e4a1; /* 상큼한 연두색 */
    box-shadow: 0 10px 25px rgba(183, 228, 161, 0.5);
}

/* Start Screen */
#start-screen {
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}

#start-screen h1 {
    font-size: 6rem;
    color: #fff;
    text-shadow: 0 8px 0 var(--mint-primary), 0 15px 30px rgba(0,0,0,0.1);
    margin-bottom: 50px;
    font-weight: 900;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    width: 90%;
    max-width: 550px;
    display: none; /* 기본 숨김 */
}

#start-screen {
    z-index: 10;
    background-color: #f0faf0; /* 이미지 로딩 실패 시 백업 색상 */
}

.logo-wrapper {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 840px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.logo-main {
    width: 90%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    filter: drop-shadow(0 15px 45px rgba(0,0,0,0.18));
}

.login-mini-logo {
    width: 180px;
    margin-top: -20px; /* 조금 더 위로 */
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.login-mini-logo:hover {
    transform: scale(1.05);
}

.login-card {
    background: #ffffff;
    border: 4px solid #fff;
    border-radius: 50px;
    box-shadow: var(--shadow-medium);
    padding: 40px;
    width: 480px; /* 고정 너비로 통일 */
    position: relative; 
    z-index: 10;
}

/* 오른쪽 책갈피 탭 컨테이너 */
.login-tabs-container {
    position: absolute;
    right: -55px; /* 기본적으로 55px 노출, 15px만 카드 뒤에 숨김 */
    top: 60px;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 5;
}

.grid-item {
    background: #fff;
    border: 2.5px solid var(--mint-pale);
    border-radius: 20px;
    box-shadow: 0 4px 0 var(--mint-pale);
    transition: all 0.2s ease;
    color: var(--mint-dark);
    padding: 12px 0; /* 세로 폭 축소 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item:hover {
    transform: translateY(-2px);
    border-color: var(--mint-primary);
    box-shadow: 0 7px 0 var(--mint-primary);
}

.grid-item:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--mint-primary);
}

/* Galaxy Dashboard */
#dashboard-section {
    background-size: cover;
    background-position: center;
    color: #fff;
}

.level-swiper {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}


.level-swiper::-webkit-scrollbar {
    display: none;
}

.level-card {
    min-width: 260px;
    height: 340px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid #fff;
    border-radius: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    padding: 40px 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    box-shadow: 0 15px 35px rgba(85, 179, 70, 0.1);
}

.level-card::before {
    content: '';
    position: absolute;
    top: 40px;
    width: 120px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    transition: transform 0.4s ease;
}

#card-level-1::before { content: '🌱'; font-size: 80px; display: flex; align-items: center; justify-content: center; }
#card-level-2::before { content: '🌿'; font-size: 80px; display: flex; align-items: center; justify-content: center; }
#card-level-3::before { content: '🌸'; font-size: 80px; display: flex; align-items: center; justify-content: center; }
#card-level-4::before { content: '🌳'; font-size: 80px; display: flex; align-items: center; justify-content: center; }

.level-card:hover {
    transform: translateY(-15px) scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.level-card.locked {
    filter: grayscale(0.8) brightness(0.6);
    cursor: not-allowed;
    opacity: 0.7;
}

.level-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 1.8rem;
    filter: none;
}

.level-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #1a5b4a; /* Dark Forest Green */
}

.level-desc {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50; /* Dark Navy for subtitle */
    opacity: 0.8;
}


/* Slider Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 65px;
    height: 65px;
    background: white;
    border: 4px solid #b7e4a1;
    border-radius: 50%;
    color: #46b3a5;
    font-size: 1.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


.slider-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.left-btn { left: 40px; }
.slider-btn.right-btn { right: 40px; }

/* Menu & Action Buttons */
.menu-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.shop-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: #ff9d76;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(255, 157, 118, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    z-index: 50;
}

.shop-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 157, 118, 0.6);
}

/* Slide Animations (Cleaned up to avoid interference) */
.slide-active {
    opacity: 1 !important;
    transform: scale(1) !important;
}


/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-blur: 5px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 800px;
    border-radius: 30px;
    padding: 40px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 4s ease-in-out infinite;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Dashboard Header Area */
.login-mini-logo {
    transition: transform 0.3s ease;
}

.login-mini-logo:hover {
    transform: scale(1.05);
}



/* Dashboard Profile Drawer */
.info-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-drawer.open {
    right: 0;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
}

.drawer-overlay.visible {
    display: block;
}

.dashboard-logo {
    height: 60px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.dashboard-logo:hover {
    transform: scale(1.05);
}


/* Student Management List */
.student-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.level-toggles {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #ddd;
}

.toggle-btn.active {
    background: var(--mint-primary);
    color: #fff;
    border-color: var(--mint-primary);
}

.premium-input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 20px;
    border: 2px solid var(--mint-pale);
    outline: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav-tab {
    padding: 10px 25px;
    border-radius: 15px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.nav-tab.active {
    background: var(--mint-light);
    color: var(--mint-primary);
    border-color: var(--mint-primary);
}

.nav-tab:hover:not(.active) {
    background: #f1f5f9;
}

.aiedu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    background: var(--mint-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 900;
}

.korean-embed-card {
    background: #fff;
    border: 2px solid #eef2f7;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.06);
}

.korean-embed-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 18px;
    background: #fff;
    touch-action: none;
}

.drawing-color-swatch {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #d8e2ed, 0 4px 10px rgba(44, 62, 80, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drawing-color-swatch:hover,
.drawing-color-swatch.active {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 0 0 3px var(--mint-primary), 0 8px 16px rgba(44, 62, 80, 0.14);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d9ead2;
    border-radius: 999px;
}

#my-korean-section,
#learning-start-section,
#learning-detail-section,
#letter-writing-section,
#word-writing-quiz-section,
#word-listening-quiz-section,
#my-drawing-section,
#drawing-workspace-section,
#my-dictation-section,
#dictation-workspace-section,
#spelling-quiz-section {
    align-items: stretch;
    justify-content: flex-start;
    padding: 38px;
    overflow-y: auto;
}

#my-korean-section > *,
#learning-start-section > *,
#learning-detail-section > *,
#letter-writing-section > *,
#word-writing-quiz-section > *,
#word-listening-quiz-section > *,
#my-drawing-section > *,
#drawing-workspace-section > *,
#my-dictation-section > *,
#dictation-workspace-section > *,
#spelling-quiz-section > * {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

#my-korean-section > .section-dashboard-header {
    max-width: none;
}

#my-korean-tabs .nav-tab,
#letter-writing-section .nav-tab,
#word-writing-quiz-section .nav-tab,
#listening-categories .btn-outline {
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    border-radius: 16px;
    box-shadow: none;
}

#letter-writing-section .btn-outline.active,
#word-writing-quiz-section .btn-outline.active,
#listening-categories .btn-outline.active {
    background: var(--mint-light);
    color: var(--mint-primary);
    border-color: var(--mint-primary);
}

#my-korean-list .grid-item {
    min-height: 86px;
    border-radius: 22px;
    box-shadow: 0 8px 18px rgba(85, 179, 70, 0.08);
}

#letter-writing-section .learning-pane,
#word-writing-quiz-section .learning-pane,
#word-listening-quiz-section .learning-pane {
    width: 100%;
    min-height: 0;
}

#letter-writing-section .korean-embed-canvas,
#word-writing-quiz-section .korean-embed-canvas {
    border: 2px dashed #d7e7d0;
}

#letter-writing-section .korean-embed-card,
#word-writing-quiz-section .korean-embed-card,
#word-listening-quiz-section .korean-embed-card {
    border-color: #e6f2e0;
}

.btn-choice {
    background: #ffffff;
    border: 3px solid #e6f2e0;
    border-radius: 24px;
    padding: 28px 18px;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 6px 0 #e6f2e0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-choice:hover {
    transform: translateY(-2px);
    border-color: var(--mint-primary);
    box-shadow: 0 9px 0 var(--mint-pale);
}

.btn-choice:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 var(--mint-pale);
}
