/* ==========================================================================
   APPA DOESN'T KNOW (아빠는 몰라요) - Minimalist Text-Only CSS Architecture
   Design Token System: High Contrast, Crisp Typography, Pure Mobile Focus
   ========================================================================== */

:root {
  --bg-color: #f6f0dc;
  --text-main: #111111;
  --text-muted: #4a5445;
  --text-light: #6b7765;
  --border-color: #dcd0b3;
  --border-dark: #2e6930;
  --card-bg: #fcf9ee;
  --accent-gray: #eee4cc;
  --nav-bg: #eae0c5;
  --btn-green: #00876a;
  --btn-green-hover: #006650;
  
  /* Font Family Hierarchy */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --radius: 8px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 520px;
}

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

html, body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.app-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* Header & Top Navigation */
.site-header {
  position: sticky;
  top: 0;
  background-color: var(--nav-bg);
  border-bottom: none;
  padding: 16px 20px 14px 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.38rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-main);
  background-color: rgba(252, 249, 238, 0.6);
}

.nav-link.active {
  color: var(--text-main);
  background-color: var(--card-bg);
  border: 1px solid var(--btn-green);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 135, 106, 0.16);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 20px 16px 40px 16px;
  background-color: var(--bg-color);
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active-view {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography & Headlines */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text-main);
}

.page-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* Typography Badges */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border: 1px solid var(--btn-green);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.guest-badge {
  background-color: #eee4cc;
  color: var(--text-main);
}

.badge.verified-badge {
  background-color: var(--btn-green);
  color: #ffffff;
}

/* Landing View */
.landing-hero {
  text-align: center;
  padding: 60px 10px 30px 10px;
}

.landing-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.landing-stats-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.stat-pill {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  background-color: var(--accent-gray);
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background-color: var(--btn-green);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(46, 105, 48, 0.2);
}

.btn-primary:hover {
  background-color: var(--btn-green-hover);
  box-shadow: 0 4px 12px rgba(46, 105, 48, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #fcf9ee;
  color: var(--text-main);
  border: 1px solid var(--btn-green);
  box-shadow: 0 1px 3px rgba(46, 105, 48, 0.08);
}

.btn-secondary:hover {
  background-color: #e8f2e6;
  border-color: var(--btn-green-hover);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* Lessons Cards & Progressive Locking */
.level-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  background-color: var(--card-bg);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}

.gold-star-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(212, 160, 23, 0.4));
  user-select: none;
  pointer-events: none;
  z-index: 5;
  animation: starPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starPop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.level-card:hover {
  border-color: var(--border-dark);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.level-card.locked-level {
  opacity: 0.55;
  border-color: #e2e8f0;
  background-color: var(--accent-gray);
  box-shadow: none;
}

.level-card.passed-level-card {
  border: 2px solid #37b388 !important;
  background-color: rgba(55, 179, 136, 0.06) !important;
  box-shadow: 0 4px 14px rgba(55, 179, 136, 0.15) !important;
}

.level-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.level-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.level-title {
  font-size: 1.15rem;
  margin-top: 2px;
}

.level-count-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
}

.level-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Progress Bar Component */
.progress-bar-container {
  height: 6px;
  background-color: var(--accent-gray);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--btn-green);
  width: 0%;
  transition: width 0.3s ease;
}

.level-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vocab-details {
  margin-top: 14px;
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}

.vocab-details summary {
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}

.vocab-list {
  list-style: none;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vocab-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 4px 0;
  border-bottom: 1px dotted var(--border-color);
}

.vocab-korean {
  font-weight: 700;
}

.vocab-english {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.vocab-status-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.status-new { border: 1px solid var(--border-color); color: var(--text-light); }
.status-learning { border: 1px solid var(--border-dark); color: var(--text-main); }
.status-mastered { background-color: var(--text-main); color: #ffffff; }

/* 3D Flashcards System - Light Gray Opaque Faces */
.flashcard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fc-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fc-card-container {
  min-height: 260px;
}

.fc-card-inner {
  position: relative;
  width: 100%;
  height: 260px;
  cursor: pointer;
}

.fc-card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid #9bbd78;
  border-radius: 10px;
  padding: 24px;
  background-color: #c8e5a7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

/* Front Face: English */
.fc-card-front {
  display: flex;
  z-index: 2;
}

.fc-card-inner.is-flipped .fc-card-front {
  display: none;
}

.fc-english-word-front {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Back Face: Korean */
.fc-card-back {
  display: none;
  z-index: 2;
}

.fc-card-inner.is-flipped .fc-card-back {
  display: flex;
}

.fc-korean-word-back {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 12px;
}

.fc-play-circle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  margin-top: 14px;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.fc-play-circle-btn:hover {
  background-color: #f5f5f5;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.fc-play-circle-btn:active {
  transform: scale(0.96);
}

/* 3-Button Spaced Repetition Grid */
.fc-controls-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

/* 4-Button Anki Spaced Repetition Grid */
.fc-controls-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.srs-btn-again {
  background-color: #ff8a80;
  border-color: #e53935;
  color: #111111;
  font-weight: 800;
}

.srs-btn-again:hover {
  background-color: #ff5252;
}

.srs-btn-hard {
  background-color: #ffd54f;
  border-color: #f57f17;
  color: #111111;
  font-weight: 800;
}

.srs-btn-hard:hover {
  background-color: #ffca28;
}

.srs-btn-good {
  background-color: #80e285;
  border-color: #37b388;
  color: #111111;
  font-weight: 800;
}

.srs-btn-good:hover {
  background-color: #66bb6a;
}

.srs-btn-easy {
  background-color: #4fc3f7;
  border-color: #0288d1;
  color: #111111;
  font-weight: 800;
}

.srs-btn-easy:hover {
  background-color: #29b6f6;
}

.fc-btn-again {
  background-color: #80e285;
  border-color: #5bbd60;
  color: #111111;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(128, 226, 133, 0.3);
}

.fc-btn-again:hover {
  background-color: #6ed173;
}

.fc-btn-1day {
  background-color: #37b388;
  border-color: #26946f;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(55, 179, 136, 0.3);
}

.fc-btn-1day:hover {
  background-color: #2ea079;
}

.fc-btn-3days {
  background-color: #00876a;
  border-color: #006650;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 135, 106, 0.3);
}

.fc-btn-3days:hover {
  background-color: #006b54;
}

/* Multiple Choice Test Engine Styles */
.test-question-card {
  border: 1px solid #9bbd78;
  border-radius: 10px;
  padding: 24px;
  background-color: #c8e5a7;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.test-english-prompt {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 16px 0;
}

.test-choices-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.test-choice-btn {
  text-align: left;
  justify-content: flex-start;
  padding: 14px 18px;
  font-size: 1.05rem;
  width: 100%;
  border-width: 2px;
}

.test-choice-btn strong {
  font-family: var(--font-mono);
  margin-right: 10px;
}

.test-choice-btn.choice-correct {
  background-color: #80e285 !important;
  border-color: #37b388 !important;
  color: #111111 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(55, 179, 136, 0.4);
}

.test-choice-btn.choice-wrong {
  background-color: #ff8a80 !important;
  border-color: #e53935 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(229, 57, 53, 0.4);
}

.score-badge-box {
  display: inline-block;
  border: 2px solid var(--border-dark);
  border-radius: 8px;
  padding: 12px 24px;
  margin: 16px 0;
  background-color: #ffffff;
}

.score-number {
  font-size: 2rem;
  font-weight: 900;
  font-family: var(--font-mono);
}

.test-feedback-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 8px;
}

/* Grammar Notes View */
.grammar-card {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.grammar-card-title {
  font-size: 1.15rem;
  margin: 6px 0;
}

.grammar-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Account & Progress View */
.account-profile-box {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.avatar-evolve-box {
  border: 2px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  background-color: var(--accent-gray);
}

.avatar-art-container {
  font-family: var(--font-mono);
  white-space: pre;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 12px 0;
  padding: 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: inline-block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  background-color: var(--card-bg);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.badges-section-title {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.badge-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}

.badge-card.unlocked {
  border: 1px solid var(--btn-green);
  background-color: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 135, 106, 0.12);
}

.badge-card.locked {
  opacity: 0.55;
  background-color: var(--accent-gray);
  border-color: var(--border-color);
}

.badge-icon {
  font-size: 1.5rem;
}

.badge-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.badge-title {
  font-size: 0.88rem;
}

.badge-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 4px;
}

.settings-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background-color: #ffffff;
}

.status-msg {
  font-size: 0.8rem;
  margin-top: 6px;
  font-family: var(--font-mono);
}

.status-msg.success { color: #111111; font-weight: 700; }
.status-msg.error { color: #990000; font-weight: 700; }
.status-msg.info { color: var(--text-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

@media (min-width: 520px) {
  .app-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  }
}

/* Flashcard Concept Badges and Notes */
.fc-concept-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.fc-concept-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: #f0f0f0;
  border: 1px solid #d0d0d0;
  color: #222222;
  text-transform: capitalize;
}

.fc-note-text {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: #444444;
  background: #fafafa;
  border-left: 3px solid #111111;
  padding: 8px 12px;
  margin-top: 12px;
  border-radius: 0 4px 4px 0;
  text-align: left;
  line-height: 1.4;
}

.fc-card-id-tag {
  position: absolute !important;
  bottom: 8px !important;
  left: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--font-mono);
  font-size: 0.7rem !important;
  font-weight: 600;
  color: #666666 !important;
  opacity: 0.55;
  pointer-events: none;
  z-index: 10;
  line-height: 1;
}

