/* ============================================================
   Heartopia Cozy Guide — Styles
   Cozy notebook / warm island journal theme
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #F5F0E8;
  color: #3A4A5A;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: #6ABF8A;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #5AAB7A;
}

.section {
  padding: 56px 0;
}

.section-title {
  font-size: 1.6rem;
  margin-bottom: 24px;
  color: #2C3E50;
  position: relative;
  padding-bottom: 8px;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: #6ABF8A;
  border-radius: 2px;
  margin-top: 6px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: #6A7A8A;
  margin-bottom: 24px;
}

.footnote {
  font-size: 0.85rem;
  color: #8A9AAA;
  margin-top: 20px;
  font-style: italic;
}

/* ---------- Header ---------- */
.site-header {
  background: #FFFFFF;
  border-bottom: 2px solid #E8E2D8;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3A4A5A;
  white-space: nowrap;
}

.logo:hover {
  color: #6ABF8A;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.main-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: #5A6A7A;
  padding: 4px 0;
  position: relative;
  white-space: nowrap;
}

.main-nav a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: #F0A060;
  transition: width 0.25s;
  border-radius: 1px;
}

.main-nav a:hover::after {
  width: 100%;
}

.main-nav a.nav-active {
  color: #2C3E50;
}

.main-nav a.nav-active::after {
  width: 100%;
  background: #6ABF8A;
}

.nav-full { display: inline; }
.nav-short { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #F5F0E8 0%, #EDE8DE 100%);
  padding: 80px 0 64px;
  text-align: center;
  border-bottom: 2px solid #E8E2D8;
}

.hero h1 {
  font-size: 2.4rem;
  color: #2C3E50;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #5A6A7A;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid transparent;
}

.btn-primary {
  background: #6ABF8A;
  color: #FFFFFF;
  border-color: #6ABF8A;
}

.btn-primary:hover {
  background: #5AAB7A;
  border-color: #5AAB7A;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(106, 191, 138, 0.3);
}

.btn-secondary {
  background: transparent;
  color: #3A4A5A;
  border-color: #D0CABE;
}

.btn-secondary:hover {
  background: #FFFFFF;
  border-color: #F0A060;
  color: #2C3E50;
  transform: translateY(-1px);
}

/* ---------- MVP Banner ---------- */
.mvp-banner {
  background: #FEF8E8;
  border-bottom: 1px solid #E8E2D8;
  padding: 10px 0;
  font-size: 0.85rem;
  color: #7A6A4A;
}

.mvp-banner strong {
  color: #C08040;
}

/* ---------- Quick Cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 14px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.card h3 {
  font-size: 1.1rem;
  color: #2C3E50;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9rem;
  color: #6A7A8A;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-preview {
  background: #E8F5EE;
  color: #4A9A6A;
}

.tag-coming {
  background: #FEF0E6;
  color: #D08040;
}

/* ---------- Beginner Route Steps ---------- */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 12px;
  padding: 20px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6ABF8A;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.step-body h3 {
  font-size: 1rem;
  color: #2C3E50;
  margin-bottom: 4px;
}

.step-body p {
  font-size: 0.9rem;
  color: #6A7A8A;
}

/* ---------- Codes Preview ---------- */
.codes-warning {
  background: #FFF0E8;
  border: 1px solid #F0C8B0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: #8A4A2A;
  line-height: 1.5;
}

.codes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.code-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 10px;
  padding: 14px 18px;
}

.code-item code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9rem;
  color: #2C3E50;
  background: #F5F0E8;
  padding: 4px 10px;
  border-radius: 6px;
  word-break: break-all;
}

.btn-copy {
  flex-shrink: 0;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #F0A060;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: #E08A40;
}

.btn-copy:active {
  transform: scale(0.96);
}

.btn-copy.copied {
  background: #6ABF8A;
}

/* ---------- Database Preview ---------- */
.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.db-block {
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 14px;
  padding: 20px;
}

.db-block h3 {
  font-size: 1.05rem;
  color: #2C3E50;
  margin-bottom: 14px;
}

.db-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.db-block th {
  text-align: left;
  font-weight: 600;
  color: #3A4A5A;
  padding: 8px 6px 8px 0;
  border-bottom: 2px solid #E8E2D8;
}

.db-block td {
  padding: 8px 6px 8px 0;
  border-bottom: 1px solid #F0ECE4;
  color: #5A6A7A;
}

.db-block tr:last-child td {
  border-bottom: none;
}

.db-note {
  font-size: 0.82rem;
  color: #8A9AAA;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #F0ECE4;
  font-style: italic;
}

/* ---------- Checklist ---------- */
.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.95rem;
  color: #3A4A5A;
  cursor: pointer;
  transition: background 0.2s;
}

.check-item:hover {
  background: #FAF8F4;
}

.check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #6ABF8A;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.check-item input[type="checkbox"]:checked + span {
  color: #8A9AAA;
  text-decoration: line-through;
}

/* ---------- Beginner Guide: Mistakes ---------- */
.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mistake-item {
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #F0A060;
}

.mistake-item h3 {
  font-size: 1rem;
  color: #2C3E50;
  margin-bottom: 6px;
}

.mistake-consequence {
  font-size: 0.9rem;
  color: #6A7A8A;
  line-height: 1.6;
}

/* ---------- Beginner Guide: Priority Cards ---------- */
.card-priority {
  border-top: 4px solid #6ABF8A;
}

/* ---------- Beginner Guide: Future List ---------- */
.future-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.future-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 12px;
  padding: 18px 20px;
}

.future-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6ABF8A;
  margin-top: 2px;
  position: relative;
}

.future-icon::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 5px;
  width: 6px;
  height: 10px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.future-item h3 {
  font-size: 0.95rem;
  color: #2C3E50;
  margin-bottom: 4px;
}

.future-item p {
  font-size: 0.88rem;
  color: #6A7A8A;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 700px;
}

.faq-item {
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 10px;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #3A4A5A;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #6ABF8A;
  border-bottom: 2px solid #6ABF8A;
  transform: rotate(-45deg);
  margin-right: 12px;
  transition: transform 0.25s;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: #2C3E50;
}

.faq-item p {
  padding: 0 20px 16px 38px;
  font-size: 0.9rem;
  color: #6A7A8A;
  line-height: 1.6;
}

/* ---------- Recipes: Status Cards ---------- */
.status-card {
  border-top: 4px solid #F0A060;
}

/* ---------- Recipes: Search Box ---------- */
.search-box {
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 2px solid #D0CABE;
  border-radius: 10px;
  background: #FFFFFF;
  color: #3A4A5A;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #6ABF8A;
}

.search-box input::placeholder {
  color: #AAB5C0;
}

/* ---------- Recipes: Table ---------- */
.table-wrap {
  overflow-x: auto;
}

.recipe-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 14px;
  overflow: hidden;
}

.recipe-table th,
.data-table th {
  text-align: left;
  font-weight: 600;
  color: #FFFFFF;
  background: #6ABF8A;
  padding: 12px 14px;
  white-space: nowrap;
}

.recipe-table td,
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #F0ECE4;
  color: #5A6A7A;
}

.recipe-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.recipe-table tbody tr:hover,
.data-table tbody tr:hover {
  background: #F8FCFA;
}

.status-placeholder {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #FEF0E6;
  color: #D08040;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-no-result {
  font-size: 0.9rem;
  color: #8A9AAA;
  padding: 20px 0 0;
  font-style: italic;
}

/* ---------- Recipes: Data Policy ---------- */
.data-policy {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.policy-item {
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 12px;
  padding: 20px;
}

.policy-item h3 {
  font-size: 0.95rem;
  color: #2C3E50;
  margin-bottom: 8px;
}

.policy-item p {
  font-size: 0.88rem;
  color: #6A7A8A;
  line-height: 1.6;
}

/* ---------- Codes: Empty State ---------- */
.empty-state {
  background: #FFFFFF;
  border: 2px dashed #D0CABE;
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #3A4A5A;
  margin-bottom: 12px;
}

.empty-state-desc {
  font-size: 0.9rem;
  color: #6A7A8A;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Codes: Code Status Cards ---------- */
.code-status-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.code-status {
  border-top: 4px solid #F0A060;
  text-align: center;
}

.code-status h3 {
  color: #2C3E50;
  margin-bottom: 8px;
}

.code-status p {
  font-size: 0.88rem;
  margin-bottom: 0;
}

/* ---------- Codes: Table Empty Row ---------- */
.data-table td.empty-row {
  text-align: center;
  font-style: italic;
  color: #8A9AAA;
  padding: 24px 14px;
}

/* ---------- Checklist: Groups ---------- */
.checklist-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.checklist-card {
  background: #FFFFFF;
  border: 1px solid #E8E2D8;
  border-radius: 14px;
  padding: 20px;
}

.checklist-group-title {
  font-size: 1rem;
  color: #2C3E50;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #6ABF8A;
}

.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  font-size: 0.88rem;
  padding: 10px 14px;
  cursor: pointer;
}

/* ---------- Checklist: Progress Placeholder ---------- */
.progress-placeholder {
  background: #FFFFFF;
  border: 2px dashed #D0CABE;
  border-radius: 14px;
  padding: 36px 24px;
  text-align: center;
}

.progress-placeholder-title {
  font-size: 1rem;
  font-weight: 700;
  color: #3A4A5A;
  margin-bottom: 10px;
}

.progress-placeholder-desc {
  font-size: 0.9rem;
  color: #6A7A8A;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Language Selector ---------- */
.language-wrapper {
  flex-shrink: 0;
}

.language-select {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 4px 8px;
  border: 1px solid #D0CABE;
  border-radius: 8px;
  background: #FFFFFF;
  color: #3A4A5A;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.language-select:focus {
  border-color: #6ABF8A;
}

.language-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #3A4A5A;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.88rem;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  pointer-events: none;
}

.language-toast.language-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #3A4A5A;
  color: #C0C8D0;
  padding: 40px 0;
  margin-top: 32px;
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  font-size: 1rem;
  font-weight: 700;
  color: #E0E6EA;
  margin-bottom: 12px;
}

.footer-disclaimer {
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto;
  color: #9AAABA;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-full { display: none; }
  .nav-short { display: inline; }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 6px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.35rem 0.5rem;
  }

  .main-nav a.nav-active {
    background: rgba(106, 191, 138, 0.14);
    border-radius: 999px;
  }

  .main-nav a.nav-active::after {
    display: none;
  }

  .language-wrapper {
    margin-left: auto;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 320px;
    text-align: center;
  }

  .section {
    padding: 36px 0;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .db-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .db-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
