/* MANDALA ART THERAPY - CORE DESIGN SYSTEM */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #090D16;
  --bg-card: #131A29;
  --bg-card-hover: #1A2338;
  --bg-surface: rgba(19, 26, 41, 0.85);
  
  --gold-primary: #E5B842;
  --gold-light: #FDE047;
  --gold-dark: #B48821;
  --gold-gradient: linear-gradient(135deg, #FDE047 0%, #E5B842 50%, #B48821 100%);
  
  --accent-teal: #14B8A6;
  --accent-purple: #8B5CF6;
  --accent-rose: #F43F5E;
  --accent-amber: #F59E0B;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --border-subtle: rgba(229, 184, 66, 0.18);
  --border-active: rgba(229, 184, 66, 0.5);
  
  --shadow-lux: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(229, 184, 66, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-serif: 'Cinzel', serif;
  --font-quote: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(20, 184, 166, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(229, 184, 66, 0.03) 0%, transparent 60%);
}

/* --- HEADER & NAVIGATION --- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gold-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(229, 184, 66, 0.3);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Nav Tabs - Single Line Layout */
.nav-tabs-container {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  gap: 3px;
  flex-wrap: nowrap;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab-btn.active {
  background: var(--gold-gradient);
  color: #0F172A;
  box-shadow: 0 2px 10px rgba(229, 184, 66, 0.3);
}

/* Profile Dropdown Navigation Component */
.profile-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.profile-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dropdown-caret {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.profile-dropdown-wrapper.open .dropdown-caret {
  transform: rotate(180deg);
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #111827;
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(229, 184, 66, 0.15);
  padding: 8px 0;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: fadeIn 0.18s ease forwards;
}

.profile-dropdown-wrapper.open .profile-dropdown-menu {
  display: flex;
}

.dropdown-user-header {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-user-email {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(229, 184, 66, 0.12);
  color: var(--gold-light);
  padding-left: 20px;
}

.dropdown-auth-btn-row {
  display: flex;
  gap: 8px;
  padding: 8px 14px 4px 14px;
}

.dropdown-auth-btn-row .btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 0.78rem;
}

/* Header Utilities */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-primary);
  background: rgba(229, 184, 66, 0.12);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold-primary);
}

/* --- MAIN APP VIEWS --- */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-view {
  display: none;
  width: 100%;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.app-view.active {
  display: flex;
  flex-direction: column;
}

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

/* --- COMMON BUTTONS & INPUTS --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #0F172A;
  box-shadow: 0 4px 14px rgba(229, 184, 66, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(229, 184, 66, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--gold-primary);
}

.btn-accent {
  background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
  color: #FFFFFF;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(20, 184, 166, 0.35);
}

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

.btn-outline:hover {
  background: rgba(229, 184, 66, 0.1);
}

.form-select, .form-input {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-select:focus, .form-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(229, 184, 66, 0.2);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.chapter-1 { background: rgba(74, 144, 226, 0.2); color: #60A5FA; border: 1px solid rgba(74, 144, 226, 0.3); }
.badge.chapter-2 { background: rgba(46, 204, 113, 0.2); color: #4ADE80; border: 1px solid rgba(46, 204, 113, 0.3); }
.badge.chapter-3 { background: rgba(243, 156, 18, 0.2); color: #FBBF24; border: 1px solid rgba(243, 156, 18, 0.3); }
.badge.chapter-4 { background: rgba(155, 89, 182, 0.2); color: #C084FC; border: 1px solid rgba(155, 89, 182, 0.3); }
.badge.chapter-5 { background: rgba(230, 126, 34, 0.2); color: #FB923C; border: 1px solid rgba(230, 126, 34, 0.3); }
.badge.chapter-6 { background: rgba(211, 84, 0, 0.2); color: #F87171; border: 1px solid rgba(211, 84, 0, 0.3); }

/* --- MODAL --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lux);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

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

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-light);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #FFFFFF;
}

.modal-image-preview {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* Modal Form Styles */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-helper-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.modal-switch-auth {
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-switch-auth a {
  color: var(--gold-light);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Checkout Modal Styles */
.checkout-summary-box {
  background: rgba(229, 184, 66, 0.08);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-plan-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.checkout-plan-price {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold-light);
}

.card-inputs-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
}

.test-card-hint {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.test-card-hint button {
  background: var(--gold-gradient);
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  color: #0F172A;
  cursor: pointer;
}

/* Auth Header Pill */
.auth-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 184, 66, 0.12);
  border: 1px solid var(--border-active);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-user-btn:hover {
  background: var(--gold-gradient);
  color: #0F172A;
}

.auth-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #0F172A;
}

/* --- SEO GUIDE, BENEFITS & FAQ SECTION STYLES --- */

.guide-view-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 60px 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.seo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lux);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.seo-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seo-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.seo-heading {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--text-main);
  line-height: 1.25;
}

.seo-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Age Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.benefit-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.benefit-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-primary);
}

.benefit-icon-badge {
  font-size: 2rem;
  margin-bottom: 4px;
}

.benefit-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-light);
}

.benefit-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* How-To 4 Steps Grid */
.howto-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.step-card {
  background: rgba(229, 184, 66, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
}

.step-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--gold-gradient);
  color: #0F172A;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.step-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Chapters Table List */
.chapters-index-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.chapters-index-table th {
  text-align: left;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-active);
}

.chapters-index-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chapters-index-table tr:hover td {
  background: rgba(229, 184, 66, 0.05);
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item[open] {
  border-color: var(--gold-primary);
  background: rgba(229, 184, 66, 0.04);
}

.faq-summary {
  padding: 18px 22px;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

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

.faq-summary::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--gold-primary);
  transition: transform 0.2s ease;
}

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

.faq-content {
  padding: 0 22px 20px 22px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 4px;
}

.faq-content p + p {
  margin-top: 10px;
}

/* --- FOOTER --- */
.app-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-nav-links {
  display: flex;
  gap: 16px;
}

.footer-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav-links a:hover {
  color: var(--gold-light);
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    padding: 12px 16px;
  }
  .nav-tabs-container {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .nav-tab-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .chapters-index-table {
    display: block;
    overflow-x: auto;
  }
}

