/* ============================================================
   Inner Command OS™ — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple:       #4C1D95;
  --purple-mid:   #6D28D9;
  --purple-light: #EDE9FE;
  --purple-pale:  #F5F3FF;
  --gold:         #B45309;
  --gold-light:   #FEF3C7;
  --bg:           #FFFFFF;
  --surface:      #FFFFFF;
  --bg-soft:      #FAFAFA;
  --text:         #1A1625;
  --text-soft:    #4B4567;
  --muted:        #6B6480;
  --dim:          #B0AAC8;
  --border:       #E8E4F0;
  --border-light: #F0EDF8;
  --green:        #059669;
  --red:          #DC2626;
  --shadow-sm:    0 1px 4px rgba(76,29,149,0.06);
  --shadow-md:    0 2px 16px rgba(76,29,149,0.08);
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full: 999px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 90px;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
.serif { font-family: 'Playfair Display', serif; }

.page-phase {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--purple-mid);
  margin-bottom: 8px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px; font-weight: 700;
  color: var(--text); line-height: 1.2;
  margin-bottom: 6px;
}
.page-subtitle { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

.card-purple {
  background: linear-gradient(135deg, #2D1467 0%, #4C1D95 50%, #6D28D9 100%);
  border-radius: var(--r-lg);
  color: #fff;
}

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--purple-mid);
  box-shadow: 0 0 0 3px rgba(109,40,217,0.08);
}
.input::placeholder { color: var(--dim); }

textarea.input { min-height: 90px; resize: vertical; line-height: 1.6; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6480' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border: none; border-radius: var(--r-md);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.18s; text-decoration: none;
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-mid) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(76,29,149,0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(76,29,149,0.36); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--purple-mid); background: var(--purple-pale); }

.btn-white {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-white:hover { background: rgba(255,255,255,0.25); }

/* ─── PROGRESS ───────────────────────────────────────────── */
.prog-track { height: 5px; background: var(--border); border-radius: var(--r-full); overflow: hidden; }
.prog-fill  { height: 100%; background: linear-gradient(90deg, var(--purple), var(--purple-mid)); border-radius: var(--r-full); transition: width 0.5s ease; }

/* ─── QUESTION CARDS (check-in / reflection forms) ──────── */
.q-card {
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.q-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.45;
}

/* ─── SCALE SLIDER ───────────────────────────────────────── */
.scale-wrap { display: flex; flex-direction: column; gap: 8px; }
.scale-row  { display: flex; align-items: center; gap: 12px; }
.scale-val  { font-size: 22px; font-weight: 700; color: var(--purple); min-width: 28px; }
.scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); }
.scale-slider {
  flex: 1; -webkit-appearance: none; height: 5px;
  border-radius: var(--r-full); background: var(--border); outline: none; cursor: pointer;
}
.scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  cursor: pointer; box-shadow: 0 2px 8px rgba(76,29,149,0.3); border: 3px solid #fff;
}

/* ─── YES/NO ─────────────────────────────────────────────── */
.yn-row { display: flex; gap: 8px; }
.yn-btn {
  flex: 1; padding: 11px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; transition: all 0.18s; color: var(--muted);
}
.yn-btn.yes.selected { border-color: var(--green); background: #DCFCE7; color: #065F46; }
.yn-btn.no.selected  { border-color: var(--red);   background: #FEE2E2; color: #991B1B; }

/* ─── REACTION PILLS ─────────────────────────────────────── */
.reaction-row { display: flex; flex-wrap: wrap; gap: 8px; }
.react-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border: 1px solid var(--border); border-radius: var(--r-full);
  font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer;
  font-family: 'Inter', sans-serif; background: var(--surface);
  transition: all 0.18s;
}
.react-pill:hover { border-color: var(--purple-mid); color: var(--purple-mid); background: var(--purple-pale); }
.react-pill.reacted { border-color: var(--purple-mid); color: var(--purple); background: var(--purple-pale); font-weight: 600; }
.react-count { font-size: 11px; }

/* ─── SECTION LABEL ──────────────────────────────────────── */
.section-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 12px;
}

/* ─── DIVIDER ────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── BADGE ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gold   { background: var(--gold-light); color: var(--gold); }
.badge-white  { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); }
.badge-green  { background: #DCFCE7; color: #065F46; }

/* ─── SUCCESS CARD ───────────────────────────────────────── */
.success-card {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border: 1px solid #A7F3D0; border-radius: var(--r-lg);
  padding: 32px 24px; text-align: center;
}
.success-icon  { font-size: 52px; margin-bottom: 14px; }
.success-title { font-family: 'Playfair Display', serif; font-size: 22px; color: #064E3B; margin-bottom: 6px; }
.success-sub   { color: #047857; font-size: 14px; line-height: 1.5; }
.success-pts   { font-size: 20px; font-weight: 800; color: #047857; margin-top: 12px; }

/* ─── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 26px; z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; padding: 6px 14px; border-radius: 10px; transition: all 0.18s;
}
.nav-item.active { background: var(--purple-pale); }
.nav-icon  { font-size: 21px; }
.nav-label { font-size: 10px; color: var(--dim); font-weight: 600; letter-spacing: 0.2px; }
.nav-item.active .nav-label { color: var(--purple); }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.page-wrap    { max-width: 560px; margin: 0 auto; padding: 0 20px; }
.page-header  { padding: 28px 20px 20px; max-width: 560px; margin: 0 auto; }
.content-wrap { padding: 0 20px 20px; max-width: 560px; margin: 0 auto; }

/* ─── TEXT VISIBILITY ────────────────────────────────────── */
/* Section labels — more legible */
.section-label {
  font-size: 12px; font-weight: 700; color: var(--text-soft);
  letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 12px;
}

/* Field labels — darker and slightly bigger */
.field label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* ─── DESKTOP SIDEBAR LAYOUT ─────────────────────────────── */
@media (min-width: 768px) {
  /* Shift body content right to make room for sidebar */
  body {
    padding-bottom: 0;
    padding-left: 230px;
  }

  /* Bottom nav → fixed left sidebar */
  .bottom-nav {
    position: fixed;
    left: 0; top: 0; bottom: 0; right: auto;
    width: 230px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 24px 12px 28px;
    border-top: none;
    border-right: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow-y: auto;
    gap: 2px;
  }

  /* Brand name in sidebar */
  .bottom-nav::before {
    content: "Inner Command OS™";
    font-family: 'Playfair Display', serif;
    font-size: 14px; font-weight: 700; color: var(--purple);
    display: block;
    padding: 4px 12px 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
  }

  /* Nav items: horizontal icon + label */
  .nav-item {
    flex-direction: row;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    justify-content: flex-start;
    border-radius: var(--r-md);
  }
  .nav-item.active { background: var(--purple-pale); }
  .nav-icon  { font-size: 18px; }
  .nav-label { font-size: 14px; font-weight: 600; color: var(--text-soft); }
  .nav-item.active .nav-label { color: var(--purple); }

  /* Hide duplicate logo from top bar (sidebar has it) */
  .top-bar-logo { display: none; }
  .top-bar { max-width: 100%; padding: 16px 48px; }

  /* Expand all content areas to fill the desktop canvas */
  .page-header {
    max-width: 1100px !important;
    margin-left: 0 !important; margin-right: auto !important;
    padding-left: 48px !important; padding-right: 48px !important;
  }
  .content-wrap {
    max-width: 1100px !important;
    margin-left: 0 !important; margin-right: auto !important;
    padding-left: 48px !important; padding-right: 48px !important;
  }
  .page-wrap {
    max-width: 1100px !important;
    margin-left: 0 !important; margin-right: auto !important;
    padding-left: 48px !important; padding-right: 48px !important;
  }
  .tab-content {
    max-width: 1100px !important;
    margin: 0 !important;
    padding: 32px 48px !important;
  }
}

/* ─── DESKTOP GRID IMPROVEMENTS ─────────────────────────── */
@media (min-width: 900px) {
  /* Dashboard stats — 4 cols on wide screens */
  /* (individual pages can opt in) */
}

/* ─── TOP BAR ────────────────────────────────────────────── */
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}
.top-bar-logo { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--text); font-weight: 700; }
.top-bar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; cursor: pointer; flex-shrink: 0;
}
