@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Gamja+Flower&family=Noto+Sans+KR:wght@400;600;700;800&display=swap');

:root {
    --primary-color: #14b8a6;
    --primary-hover: #0d9488;
    --secondary-color: #2a9d8f;
    --accent-gold: #f4a261;
    --bg-dark: #1e293b;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 32px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-heading: 'Gamja Flower', 'Pretendard', sans-serif;
    --font-body: 'Noto Sans KR', 'Pretendard', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: #f1f5f9;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 & 네비게이션 */
.app-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2.2rem;
    background: rgba(255,255,255,0.1);
    padding: 0.4rem;
    border-radius: var(--radius-md);
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 700;
    color: #fde047;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* 헤더 프로필 & 배지 상태 */
.user-profile-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.08);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    backdrop-filter: blur(8px);
}

.point-badge {
    background: #f59e0b;
    color: #000;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
}

.role-switch-btn {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.role-switch-btn:hover {
    background: #7dd3fc;
}

.badge-collection-preview {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.badge-collection-preview .badge-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    font-size: 1rem;
    transition: transform 0.2s;
    overflow: hidden;
    flex-shrink: 0;
}

.badge-collection-preview .badge-name,
.badge-collection-preview .badge-desc {
    display: none !important;
}

.badge-item.locked {
    opacity: 0.3;
    filter: grayscale(100%);
}

.badge-item.unlocked {
    opacity: 1;
    background: #fde047;
    animation: popIn 0.3s ease;
}

/* 네비게이션 메인 탭 */
.app-nav {
    display: flex;
    gap: 0.3rem;
    background: rgba(255,255,255,0.05);
    padding: 0.3rem;
    border-radius: 12px;
    flex-wrap: wrap;
}

.nav-item {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    color: #0f172a;
    background: #fde047;
    font-weight: 700;
}

/* 메인 컨테이너 */
.app-main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* 1. 시대별 탐험관 */
.explorer-hero {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.explorer-hero h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.era-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
}

.era-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.era-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.era-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.era-icon {
    font-size: 2.5rem;
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 12px;
}

.era-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.era-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.era-standards-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: #1e40af;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.era-summary {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 1rem;
}

.era-keypoints {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.era-keypoints ul {
    margin-left: 1.2rem;
    margin-top: 0.3rem;
}

.era-vocab-box {
    background: #fefce8;
    border: 1px solid #fef08a;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.era-vocab-box h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #854d0e;
    margin-bottom: 0.4rem;
}

.vocab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.vocab-item {
    background: #ffffff;
    border: 1px solid #fde047;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #713f12;
    cursor: help;
}

.era-topics {
    margin-bottom: 1.2rem;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.tag {
    background: #e2e8f0;
    color: #334155;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

.era-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 2. 에디터 & 활동 탭 */
.editor-layout, .timeline-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .editor-layout, .timeline-layout {
        grid-template-columns: 1fr;
    }
}

.editor-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.activity-subtab {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.activity-subtab.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

.act-fields {
    display: none;
    margin-top: 1.5rem;
}

.act-fields.active {
    display: block;
}

/* 캔버스 및 그림판 */
.canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

canvas#historyCanvas {
    background: #ffffff;
    border: 3px solid #cbd5e1;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
}

.canvas-toolbar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.color-picker-group, .size-picker-group, .tools-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    transition: transform 0.15s;
}

.color-dot.active {
    transform: scale(1.25);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.size-btn, .tool-btn {
    border: 1px solid var(--border-color);
    background: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.size-btn.active, .tool-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.sticker-box {
    width: 100%;
    margin-top: 0.5rem;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 0.4rem;
    max-height: 120px;
    overflow-y: auto;
    padding: 0.4rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.sticker-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.3rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    transition: transform 0.15s;
}

.sticker-btn span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sticker-btn:hover {
    transform: scale(1.08);
    background: #fef08a;
}

/* 버튼 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: #475569;
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* 3. 연표 빌더 타임라인 */
.interactive-timeline-container {
    flex: 1;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 45px;
    top: 20px;
    bottom: 20px;
    width: 4px;
    background: #cbd5e1;
    z-index: 1;
}

.timeline-node {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.node-bullet {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 0 4px #ffffff, var(--shadow-sm);
    flex-shrink: 0;
}

.node-card {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    flex: 1;
}

.node-img-box {
    margin-top: 0.5rem;
    max-height: 140px;
    overflow: hidden;
    border-radius: 8px;
}

.node-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.node-year {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.node-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.node-desc {
    font-size: 0.88rem;
    color: #475569;
}

/* 4. 서재 (모아보기 카드) */
.bookshelf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.note-preview-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.note-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.note-card-header {
    padding: 0.75rem 1rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.9rem;
}

.note-template-badge {
    background: rgba(255,255,255,0.25);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.78rem;
}

.note-card-canvas {
    height: 180px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.note-card-canvas img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.note-card-body {
    padding: 1rem;
    flex: 1;
}

.note-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.note-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.note-card-desc {
    font-size: 0.88rem;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card-actions {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

/* 5. 퀴즈 도전 레이아웃 */
.quiz-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 6px solid var(--primary-color);
}

.quiz-card.solved {
    border-left-color: var(--secondary-color);
    background: #f0fdf4;
}

.quiz-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.quiz-card.solved .quiz-badge {
    color: var(--secondary-color);
}

.quiz-question {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.quiz-opt-btn {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.quiz-opt-btn:hover {
    border-color: var(--primary-color);
    background: #fff5f5;
}

.quiz-opt-btn.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.quiz-explanation {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border: 1px solid #bbf7d0;
}

/* 6. 학습 분석 대시보드 및 교사 대시보드 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.dash-stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.dash-stat-icon {
    font-size: 2.5rem;
    background: #f1f5f9;
    padding: 0.6rem;
    border-radius: 16px;
}

.dash-stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.dash-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.era-progress-row {
    margin-bottom: 1rem;
}

.era-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.progress-bar-track {
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2a9d8f, #e76f51);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.full-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.full-badge-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.full-badge-card.unlocked {
    border-color: #f59e0b;
    background: #fefce8;
}

.full-badge-card.locked {
    opacity: 0.55;
    filter: grayscale(80%);
}

.full-badge-icon {
    font-size: 2.2rem;
    background: white;
    padding: 0.4rem;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.full-badge-info h4 {
    font-size: 1rem;
    font-weight: 700;
}

.full-badge-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 교사 테이블 스타일 */
.table-responsive {
    overflow-x: auto;
}

.teacher-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.teacher-table th, .teacher-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.teacher-table th {
    background: #f8fafc;
    font-weight: 700;
}

/* 스토리북 & AI 챗봇 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.deepdive-tab {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.deepdive-tab:hover {
    color: #0f172a;
}

.deepdive-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


.storybook-box {
    background: #fefce8;
    border: 1px solid #fef08a;
    padding: 1.25rem;
    border-radius: var(--radius-md);
}

.storybook-box h4 {
    font-size: 1.1rem;
    color: #854d0e;
    margin-bottom: 0.75rem;
}

.storybook-box p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #334155;
    white-space: pre-line;
}

.chatbot-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 320px;
}

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.chatbot-avatar {
    font-size: 1.8rem;
    background: #ffffff;
    padding: 0.3rem;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chatbot-msg {
    max-width: 80%;
    padding: 0.65rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chatbot-msg.bot {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-top-left-radius: 4px;
}

.chatbot-msg.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 4px;
}

.chatbot-input-area {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* 토스트 및 모달 */
.app-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    pointer-events: none;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

/* 키프레임 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0% { transform: scale(0.6); }
    80% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* 상세 인쇄용 CSS (@media print) */
@media print {
    .app-header, .bookshelf-toolbar, .note-card-actions, .app-nav, .role-switch-btn {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .app-main {
        margin: 0;
        padding: 0;
    }
    .bookshelf-grid {
        grid-template-columns: 1fr;
    }
    .note-preview-card {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #000;
        margin-bottom: 2rem;
        page-break-after: always;
    }
    .note-card-desc {
        -webkit-line-clamp: initial;
        white-space: pre-wrap;
    }
    .note-card-canvas {
        height: 300px;
    }
}
