/* Layout System - Only styles used by index.html */

/* Hero Section — Figma 37974:17631 (no background, no border) */
.hero-section {
  text-align: center;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.hero-title {
  font-size: var(--display-xs, 24px);
  font-weight: 600;
  line-height: var(--leading-display-xs, 32px);
  color: var(--text-primary-900, #1A2718);
  margin: 0;
}

.hero-subtitle {
  font-size: var(--text-md, 16px);
  font-weight: 400;
  line-height: var(--leading-md, 24px);
  color: var(--text-tertiary-600, #536255);
  margin: 0;
}

/* Small Hero Section - Compact variant */
.hero-section.hero-small {
  padding: 16px 20px;
}

.hero-small .hero-icon {
  width: 40px;
  height: 40px;
  font-size: 24px;
  margin-bottom: 8px;
}

.hero-small .hero-title {
  font-size: 20px;
  margin-bottom: 4px;
}

.hero-small .hero-subtitle {
  font-size: 14px;
  max-width: 100%;
}

/* Short Hero Section - Medium variant */
.hero-section.hero-short {
  padding: 24px 20px;
}

.hero-short .hero-icon {
  width: 60px;
  height: 60px;
  font-size: 32px;
  margin-bottom: 12px;
}

.hero-short .hero-title {
  font-size: 24px;
  margin-bottom: 6px;
}

.hero-short .hero-subtitle {
  font-size: 16px;
  max-width: 320px;
}

/* App Container */
.app-container {
  max-width: 428px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* App Body - Web component that adds footer */
app-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  max-width: 428px;
  margin: 0 auto;
  width: 100%;
  padding: 56px 20px 0 20px; /* 56px top padding for fixed header */
  box-sizing: border-box;
  position: relative;
  /* Background decorations moved to fixed bottom-nav in app-shell.css */
}

/* Nuclear gap — every flex/grid container inside app-body
   automatically gets 20px gap. No manual gap anywhere.
   For block-flow elements (form, div without display),
   we also set flex-column so gap activates. */
app-body * {
  gap: 20px;
}
app-body form,
app-body .section-panel {
  display: flex;
  flex-direction: column;
}


/* Divider Component */
.divider {
  text-align: center;
  position: relative;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 0.5px;
  background: var(--border-color);
}

.divider-text {
  background: var(--bg-secondary);
  padding: 0 16px;
  position: relative;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* Card Component System */
.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-green-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
  text-align: left;
}

.card-body-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-body-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.3;
  margin: 0;
}

.card-arrow {
  color: #BFBFBF;
  font-size: 24px;
  font-weight: 300;
}

.card-input-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* Card section label - for labeling groups of inputs */
.card-label {
  font-size: 14px;
  color: #6c757d;
  margin: 0;
}

/* Info Card Variant */
.info-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.info-card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.info-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.info-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
  margin: 0;
}

/* Card Grid Layout */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}


/* Modal Component */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

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

.modal-overlay .card {
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #718096;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f7fafc;
  color: #2d3748;
}

/* Footer Component */
.footer {
  text-align: center;
  padding: 40px 20px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Safe Area */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ============================================
   Shared Layout Widgets
   Canonical definitions — do not duplicate in page CSS
   ============================================ */

/* Modal Content (inner panel inside modal-overlay) */
.modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

/* Section Card (generic content container) */
.section-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

/* Stats Grid — default 2-column */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

.stat-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Summary Card */
.summary-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.summary-card .count {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.summary-card .label {
  font-size: 13px;
  color: #64748b;
}

/* Loading Spinner */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notification — shared across all pages */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: 12px 24px;
  border-radius: var(--radius-lg, 10px);
  font-family: var(--font-primary);
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  color: var(--text-white);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  animation: toast-in 0.3s ease forwards, toast-out 0.3s ease 2.2s forwards;
}

.toast--success { background: var(--brand-500, #44A148); }
.toast--error   { background: var(--color-error, #F04438); }
.toast--info    { background: var(--text-primary-900, #1A2718); }

@keyframes toast-in {
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(-50%) translateY(-100%); }
}

/* Companion Visual (centered orb container) */
.companion-visual {
  text-align: center;
  padding: 20px 0;
}

/* ============================================
   Progress Tracker — bar + fill + count
   ============================================ */
.progress-tracker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-tracker__bar {
  flex: 1;
  height: 10px;
  background: var(--border-secondary, #E9E9EB);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
}

.progress-tracker__fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-full, 9999px);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-tracker__count {
  font-family: var(--font-primary);
  font-size: var(--text-lg, 18px);
  font-weight: 600;
  line-height: 28px;
  color: var(--text-primary-900);
  flex-shrink: 0;
}

/* ============================================
   Tinted Card — colored container with label
   ============================================ */
.tinted-card {
  border-radius: var(--radius-xl, 12px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tinted-card__label {
  font-family: var(--font-primary);
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-primary-900);
  letter-spacing: 0.5px;
}

.tinted-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Tint color variants */
.tinted-card--blue   { background: var(--tint-blue, #EFF4F9); border: 1px solid #D4E0EB; }
.tinted-card--teal   { background: var(--tint-teal, #F0F8F7); border: 1px solid #D4E8E5; }
.tinted-card--purple { background: var(--tint-purple, #F8F2F8); border: 1px solid #E4D6E4; }
.tinted-card--indigo { background: var(--tint-indigo, #F2F3FC); border: 1px solid #D6D9ED; }
.tinted-card--orange { background: var(--tint-orange, #F8F3EC); border: 1px solid #E8DDD0; }

/* ============================================
   Multi-Chip — selectable chip with icon + label
   ============================================ */
.multi-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--chip-unselected-border, #E9E9EB);
  border-radius: var(--radius-lg, 10px);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: transparent;
}

.multi-chip:hover:not(.disabled) {
  border-color: var(--chip-selected-border, #A9D4AB);
  background: rgba(218, 241, 219, 0.3);
}

.multi-chip.selected {
  background: var(--chip-selected-bg, #DAF1DB);
  border-color: var(--chip-selected-border, #A9D4AB);
}

.multi-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.multi-chip__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.multi-chip__label {
  font-family: var(--font-primary);
  font-size: var(--text-sm, 14px);
  font-weight: 500;
  line-height: var(--leading-sm, 20px);
  color: var(--text-primary-900);
}

.multi-chip__remove {
  margin-left: 4px;
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
}

.multi-chip__remove:hover {
  opacity: 1;
}

/* ============================================
   Inline Add — input + button row for adding items
   ============================================ */
.inline-add {
  display: flex;
  gap: 8px;
}

.inline-add__input {
  flex: 1;
  height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--border-secondary, #E9E9EB);
  border-radius: var(--radius-xl, 12px);
  font-family: var(--font-primary);
  font-size: var(--text-sm, 14px);
  color: var(--text-primary-900);
  background: var(--bg-primary);
  outline: none;
}

.inline-add__input:focus {
  border-color: var(--brand-500);
}

/* ============================================
   Fullscreen Panel — fills viewport, pins footer to bottom
   Use on single-screen steps (welcome, vibe, confirmation)
   ============================================ */
.fullscreen-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
  padding: 32px 0;
  gap: 8px;
}

.fullscreen-panel .hero-icon {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20vh;
}

.fullscreen-panel .hero-wordmark {
  margin-top: 12px;
}

.fullscreen-panel .hero-title {
  font-size: 29px;
  margin-top: 16px;
}

.fullscreen-panel .hero-subtitle {
  font-size: 19px;
}

.fullscreen-panel .hero-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.fullscreen-panel .screen-footer {
  margin-top: auto;
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  width: 100%;
}

/* Fullscreen panel variant: left-aligned content (for form/selection steps) */
.fullscreen-panel--start {
  align-items: stretch;
  text-align: left;
}

/* Screen header inside app-body: counter the parent padding */
app-body > .screen-header {
  margin: 0 -20px;
  padding: 12px 20px;
}

/* In-flow footer variant — for scrollable pages where footer
   should sit after content instead of pinned to bottom */
.screen-footer--inflow {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
}

/* ============================================
   COLLAPSIBLE — trigger + hidden content
   ============================================ */
.collapsible__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-primary-hover);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 600;
  color: var(--text-tertiary-600);
}

.collapsible__trigger:hover {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-500);
}

.collapsible__arrow {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.collapsible__arrow.expanded {
  transform: rotate(180deg);
}

.collapsible__content {
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-primary-hover);
}

/* ============================================
   SETTINGS PANEL — bordered section for grouped controls
   ============================================ */
.settings-panel {
  background: var(--bg-primary-hover);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-secondary);
}

.settings-panel__rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-panel__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-panel__row-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary-900);
}

/* ============================================
   CONFIRM DIALOG — centered modal for yes/no confirmations
   ============================================ */
.confirm-dialog {
  text-align: center;
  max-width: 360px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.confirm-dialog__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
}

.confirm-dialog__title {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary-900);
  font-size: var(--text-lg);
  font-weight: 600;
}

.confirm-dialog__message {
  margin: 0 0 1.25rem 0;
  color: var(--text-tertiary-600);
  font-size: var(--text-sm);
}

.confirm-dialog__actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.confirm-dialog__actions button {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.confirm-dialog__dismiss {
  background: transparent;
  border: none;
  color: var(--brand-500);
  font-size: var(--text-xs);
  cursor: pointer;
}

/* ============================================
   MODAL BODY — scrollable content area inside modals
   ============================================ */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

/* ============================================
   INLINE ADD — input + button row
   ============================================ */
.inline-add {
  display: flex;
  gap: 12px;
  align-items: center;
}

.inline-add .cta-button {
  width: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ============================================
   PHOTO PREVIEW — avatar display with optional label
   ============================================ */
.photo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-preview__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-green, #44A658);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-preview__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview__avatar span {
  font-size: 1.5rem;
}

/* ============================================
   CATEGORY SECTION — titled group with content
   ============================================ */
.category-section {
  margin-bottom: 1.5rem;
}

.category-section:last-child {
  margin-bottom: 0;
}

.category-section__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary-600);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   Learner Onboarding Background — Sky
   ============================================ */
.onboarding-sky-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  pointer-events: none;
}

.onboarding-sky-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-clouds-top {
  position: fixed;
  top: 10vh;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
}

.onboarding-clouds-top img {
  width: 100%;
  height: auto;
}

.onboarding-back-clouds {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.onboarding-back-clouds img {
  height: auto;
  transform: scale(1.15);
  transform-origin: bottom;
}

.onboarding-middle-clouds {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}

.onboarding-middle-clouds img {
  width: 100%;
  height: auto;
  transform: scale(1.15);
  transform-origin: bottom;
}

.onboarding-sun {
  position: fixed;
  bottom: 2vh;
  right: 10%;
  z-index: -2;
  pointer-events: none;
}

.onboarding-sun img {
  width: 88px;
  height: auto;
}

.onboarding-hills {
  position: fixed;
  bottom: -10px;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.onboarding-hills img {
  width: 100%;
  height: auto;
}

/* ============================================
   Empty State — centered message with icon
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary-600);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary-900);
    margin-bottom: 8px;
}

.empty-state__desc {
    font-size: 14px;
    line-height: 1.4;
}

/* ============================================
   TOGGLE CARD — card with icon, content, and toggle switch
   ============================================ */
.toggle-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: #ffffff;
    border: 1px solid #f5f5f5;
    border-radius: var(--radius-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 5px 2px rgba(10, 13, 18, 0.05);
}

.toggle-card__icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: #fafafa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-card__icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.toggle-card__content {
    flex: 1;
}

.toggle-card__title {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 600;
    color: #1a2718;
    line-height: 1.3;
}

.toggle-card__hint {
    font-family: var(--font-primary);
    font-size: 13px;
    color: #838c80;
    margin-top: 2px;
}

.toggle-card__switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-card__switch input {
    display: none;
}

.toggle-card__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-card__slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-card__switch input:checked + .toggle-card__slider {
    background: var(--brand-500);
}

.toggle-card__switch input:checked + .toggle-card__slider::after {
    transform: translateX(22px);
}

/* ============================================
   App Body - Fixed Header Offset

   LEARNER UI ONLY - Provides padding for the
   fixed header-v2 component (108px + clouds).

   Teacher/admin pages use header-teacher.css instead.
   ============================================ */

app-body {
    padding-top: 118px;
}

@supports (padding-top: env(safe-area-inset-top)) {
    app-body {
        padding-top: calc(118px + env(safe-area-inset-top));
    }
}

