/* =========================================================
   고대 이집트어 학습앱 — 시누헤 이야기
   Design System | main.css
   ========================================================= */

/*
  Fonts: To ensure identical rendering across systems, place webfont files in /fonts:
  - /fonts/Inter.woff2 (variable/static) or Inter-*.woff2
  - /fonts/NotoSerif.woff2
  - /fonts/NotoSansEgyptianHieroglyphs.woff2
  These files are not included here due to size/licensing; see /fonts/README.md to download.
*/

@font-face {
  font-family: 'InterLocal';
  src: local('Inter'),
       url('../fonts/Inter.woff2') format('woff2'),
       url('../fonts/Inter.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NotoSerifLocal';
  src: local('Noto Serif'),
       url('../fonts/NotoSerif.woff2') format('woff2'),
       url('../fonts/NotoSerif.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NotoSansEgyptianHieroglyphsLocal';
  src: local('Noto Sans Egyptian Hieroglyphs'),
       url('../fonts/NotoSansEgyptianHieroglyphs.woff2') format('woff2'),
       url('../fonts/NotoSansEgyptianHieroglyphs.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── CSS 변수 ── */
:root {
  --bg:          #080a0e;
  --surface:     #0f1218;
  --surface-2:   #161c24;
  --surface-3:   #1e2630;
  --border:      #2a3545;
  --border-2:    #3a4a5e;

  --gold:        #d4a843;
  --gold-light:  #f0c96a;
  --gold-dark:   #8a6a22;
  --gold-glow:   rgba(212,168,67,0.15);

  --nile:        #1a6b8a;
  --nile-light:  #2a9cbf;
  --nile-dark:   #0f4055;
  --nile-glow:   rgba(26,107,138,0.15);

  --papyrus:     #e8d5a3;
  --papyrus-dim: #a8926a;

  --text:        #e8d5a3;
  --text-muted:  #9a8a6a;
  --text-dim:    #5a4e38;
  --text-inv:    #0a0c10;

  --accent:      #c0622a;
  --accent-l:    #e07840;

  --font-ui:     'InterLocal', sans-serif;
  --font-serif:  'NotoSerifLocal', serif;
  --font-hiero:  'NotoSansEgyptianHieroglyphsLocal', serif;

  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.5);
  --shadow:      0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.7);
  --shadow-gold: 0 0 30px rgba(212,168,67,0.2);
  --shadow-nile: 0 0 30px rgba(26,107,138,0.2);

  --transition:  all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

p { color: var(--text-muted); line-height: 1.8; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

code, .mono {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.88em;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold-light);
}

.hiero {
  font-family: var(--font-hiero);
  font-size: 1.6em;
  color: var(--gold);
  letter-spacing: 0.05em;
  line-height: 1.2;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  background: rgba(8,10,14,0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}
.navbar-brand:hover { color: var(--gold-light); }

.navbar-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin-left: auto;
}

.navbar-links li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.navbar-links li a .icon { font-size: 1em; }
.navbar-links li a:hover { background: var(--surface-2); color: var(--text); }
.navbar-links li a.active { background: var(--gold-glow); color: var(--gold-light); font-weight: 600; }

/* ── Hamburger / Drawer ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 18px;
  background: none; border: none; cursor: pointer; padding: 0; margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-drawer {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem; font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.nav-drawer a:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 900px) {
  .navbar-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ── Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 2rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--text);
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
}

.text-center { text-align: center; }
.text-center .section-desc { margin-left: auto; margin-right: auto; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

.gap-3 { gap: 3rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--text-inv);
}
.btn-primary:hover {
  background: var(--gold-light);
  color: var(--text-inv);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
}
.btn-outline:hover {
  background: var(--gold-glow);
  color: var(--gold-light);
  border-color: var(--gold);
}

.btn-nile {
  background: var(--nile);
  color: #fff;
}
.btn-nile:hover {
  background: var(--nile-light);
  box-shadow: var(--shadow-nile);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  opacity: 0;
  transition: var(--transition);
}
.module-card:hover {
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}
.module-card:hover::before { opacity: 1; }

.module-card.card-nile:hover {
  border-color: var(--nile);
  box-shadow: var(--shadow-nile);
}
.module-card.card-nile::before {
  background: linear-gradient(90deg, transparent, var(--nile-dark), transparent);
}

.module-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.module-sub { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.15rem; }
.module-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.module-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; flex: 1; margin: 0; }
.module-meta { font-size: 0.78rem; color: var(--text-dim); display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Progress Bar ── */
.progress-bar {
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ── Tags / Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold  { background: rgba(212,168,67,0.15); color: var(--gold); border: 1px solid var(--gold-dark); }
.badge-nile  { background: rgba(26,107,138,0.15); color: var(--nile-light); border: 1px solid var(--nile-dark); }
.badge-noun  { background: rgba(60,100,200,0.15); color: #7ab0f0; border: 1px solid rgba(60,100,200,0.3); }
.badge-verb  { background: rgba(60,180,100,0.15); color: #7ad0a0; border: 1px solid rgba(60,180,100,0.3); }
.badge-adj   { background: rgba(160,80,200,0.15); color: #c090e0; border: 1px solid rgba(160,80,200,0.3); }
.badge-prep  { background: rgba(220,80,60,0.15);  color: #f09080; border: 1px solid rgba(220,80,60,0.3); }
.badge-pron  { background: rgba(212,168,67,0.15); color: var(--gold); border: 1px solid var(--gold-dark); }
.badge-conj  { background: rgba(60,180,180,0.15); color: #70d0d0; border: 1px solid rgba(60,180,180,0.3); }

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.6rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }

/* ── Modals / Popups ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-title { font-family: var(--font-serif); font-size: 1.2rem; color: var(--text); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 1.2rem; padding: 0.2rem; }
.modal-close:hover { color: var(--text); }

/* ── Word Popup (Reader) ── */
.word-popup {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  width: 280px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
.word-popup.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.popup-hiero { font-family: var(--font-hiero); font-size: 2rem; color: var(--gold); margin-bottom: 0.3rem; }
.popup-translit { font-size: 1rem; font-style: italic; color: var(--text); margin-bottom: 0.2rem; }
.popup-ko { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.popup-pos { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.popup-morph { font-size: 0.78rem; color: var(--text-dim); font-family: monospace; }

/* ── Flashcard ── */
.flashcard {
  perspective: 1000px;
  height: 220px;
  cursor: pointer;
}
.flashcard-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}
.flashcard-back { transform: rotateY(180deg); background: var(--surface-2); border-color: var(--gold-dark); }
.fc-hiero { font-family: var(--font-hiero); font-size: 3rem; color: var(--gold); margin-bottom: 0.5rem; }
.fc-translit { font-size: 1.1rem; font-style: italic; color: var(--text); }
.fc-ko { font-size: 1.1rem; color: var(--gold-light); font-weight: 600; }
.fc-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ── SRS Rating Buttons ── */
.srs-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.srs-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}
.srs-btn:hover { color: var(--text); border-color: var(--border-2); }
.srs-btn.again  { border-color: rgba(220,80,60,0.4); color: #f09080; }
.srs-btn.hard   { border-color: rgba(212,168,67,0.4); color: var(--gold); }
.srs-btn.good   { border-color: rgba(60,180,100,0.4); color: #7ad0a0; }
.srs-btn.easy   { border-color: rgba(60,100,220,0.4); color: #7ab0f0; }

/* ── Quiz ── */
.quiz-option {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}
.quiz-option:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.quiz-option.correct { background: rgba(60,180,100,0.12); border-color: rgba(60,180,100,0.5); color: #7ad0a0; }
.quiz-option.wrong   { background: rgba(220,80,60,0.12);  border-color: rgba(220,80,60,0.5);  color: #f09080; }

/* ── Search ── */
.search-input {
  width: 100%;
  padding: 0.85rem 1.2rem 0.85rem 3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px var(--gold-glow); }
.search-input::placeholder { color: var(--text-dim); }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }

/* ── Sidebar Layout ── */
.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr 220px;
  min-height: calc(100vh - 64px);
  max-width: 1400px;
  margin: 0 auto;
}

.page-layout-2col {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 1.5rem 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-right {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 1.5rem;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-header {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.chapter-nav { list-style: none; padding: 0 0.5rem; }
.chapter-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: var(--transition);
  text-decoration: none;
}
.chapter-nav li a:hover { background: var(--surface-2); color: var(--text); }
.chapter-nav li a.active { background: var(--gold-glow); color: var(--gold-light); font-weight: 600; }
.chapter-nav li a .ch-num {
  width: 22px; height: 22px;
  background: var(--surface-3);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: var(--text-dim);
  flex-shrink: 0;
}
.chapter-nav li a.active .ch-num { background: var(--gold-dark); color: var(--gold-light); }

/* ── Main Content Area ── */
.main-content {
  padding: 2.5rem 3rem;
  overflow-y: auto;
}
@media (max-width: 1100px) {
  .page-layout { grid-template-columns: 220px 1fr; }
  .sidebar-right { display: none; }
  .main-content { padding: 2rem; }
}
@media (max-width: 768px) {
  .page-layout, .page-layout-2col { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .main-content { padding: 1.5rem; }
}

/* ── Hieroglyph Display ── */
.hiero-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font-hiero);
  font-size: 2.5rem;
  color: var(--gold);
  min-width: 64px;
  min-height: 64px;
  cursor: pointer;
  transition: var(--transition);
}
.hiero-box:hover { border-color: var(--gold-dark); background: var(--gold-glow); }
.hiero-box.selected { border-color: var(--gold); background: var(--gold-glow); box-shadow: var(--shadow-gold); }

/* ── Interlinear View ── */
.interlinear {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  line-height: 1;
  font-size: 0.9rem;
}
.word-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1px solid transparent;
}
.word-unit:hover { background: var(--surface-2); border-color: var(--border); }
.word-unit .w-hiero { font-family: var(--font-hiero); font-size: 1.6rem; color: var(--gold); line-height: 1; }
.word-unit .w-translit { font-style: italic; font-size: 0.82rem; color: var(--text); }
.word-unit .w-ko { font-size: 0.75rem; color: var(--text-muted); }
.word-unit .w-pos { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; }
.pos-noun  { color: #7ab0f0; }
.pos-verb  { color: #7ad0a0; }
.pos-adj   { color: #c090e0; }
.pos-prep  { color: #f09080; }
.pos-pron  { color: var(--gold); }
.pos-conj  { color: #70d0d0; }
.pos-num   { color: #f0b070; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.6s ease both; }
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.5s; }

/* ── Footer ── */
.footer {
  padding: 2.5rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Utility ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.chip:hover, .chip.active { background: var(--gold-glow); border-color: var(--gold-dark); color: var(--gold); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* ── Stat Items ── */
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); letter-spacing: 0.06em; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Tooltip ── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
[data-tip]:hover::after { opacity: 1; }

/* ── Print ── */
@media print {
  .navbar, .sidebar, .sidebar-right, .tab-bar, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .main-content { padding: 0; }
}
