/* Tawaaf — mockup site shared styles
 * Mirrors the production design system from /css/app.css and /css/info.css
 * so the mockups feel like real Tawaaf, not a sketch.
 */

:root {
  --green:    #0a2e22;
  --green-2:  #0f3d2e;
  --green-3:  #1a5440;
  --green-4:  #06241b;
  --gold:     #c9a961;
  --gold-2:   #8b6f2e;
  --gold-soft:#e8d9a9;
  --cream:    #faf8f3;
  --cream-2:  #faf4e5;
  --border:   #eee6d1;
  --ink:      #1a1a1a;
  --muted:    #666;
  --muted-2:  #888;
  --warn:     #c47a3a;
  --warn-bg:  #fbeede;
  --info:     #2f6a52;
  --tap:      48px;
  --nav-h:    calc(64px + env(safe-area-inset-bottom));
  --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.serif  { font-family: 'Fraunces', Georgia, serif; }
.arabic { font-family: 'Amiri', 'Traditional Arabic', 'Geeza Pro', serif; line-height: 1.9; direction: rtl; }
.mono   { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* Focus rings — keyboard users */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* =========================================================================
   Mockup chrome — top banner that frames every page
   ========================================================================= */
.mockup-chrome {
  background: var(--green-4);
  color: rgba(255,255,255,0.85);
  padding: 10px 16px;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.mockup-chrome a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.mockup-chrome .crumb {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: rgba(255,255,255,0.55);
}

/* =========================================================================
   Placement bar — sits under mockup-chrome on each mockup page and tells
   the reviewer exactly where this feature would live in production.
   ========================================================================= */
.placement-bar {
  background: var(--cream-2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  line-height: 1.5;
}
.placement-bar .pl-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-2);
  white-space: nowrap;
}
.placement-bar .pl-path { color: var(--green-2); font-weight: 600; }
.placement-bar .pl-path .arrow { color: var(--gold); margin: 0 6px; font-weight: 400; }
.placement-bar .pl-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.placement-bar .pl-tag.new        { background: rgba(201,169,97,0.20); color: var(--gold-2); }
.placement-bar .pl-tag.existing   { background: rgba(15,92,63,0.14);   color: #0f5c3f; }
.placement-bar .pl-tag.restructure{ background: rgba(196,122,58,0.16); color: var(--warn); }
.placement-bar .pl-tag.internal   { background: rgba(0,0,0,0.06);      color: var(--muted); }
.placement-bar .pl-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  font-family: 'Fraunces', serif;
}

/* =========================================================================
   App header (mirrors production)
   ========================================================================= */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 243, 0.95);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 16px;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.app-header.on-dark {
  background: rgba(10, 46, 34, 0.95);
  border-bottom-color: rgba(255,255,255,0.08);
}
.app-header .logo {
  font-family: 'Fraunces', serif;
  font-size: 19px; font-weight: 700;
  color: var(--green-2); text-decoration: none;
  letter-spacing: -0.2px;
  display: flex; align-items: center; gap: 8px;
}
.app-header.on-dark .logo { color: #fff; }
.app-header .logo .kaaba {
  width: 22px; height: 24px; display: inline-block;
  background: url('/logo-kaaba.svg?v=202604200300') center/contain no-repeat;
}
.app-header .header-title {
  font-size: 15px; font-weight: 600;
  color: var(--green-2);
}
.app-header.on-dark .header-title { color: #fff; }
.app-header .hijri {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-style: italic;
  color: var(--gold-2);
  letter-spacing: 0.2px;
}
.app-header.on-dark .hijri { color: var(--gold); }
.app-header-link {
  min-width: var(--tap); min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--green-2); text-decoration: none; font-size: 22px;
  margin: -12px;
}
.app-header.on-dark .app-header-link { color: #fff; }

/* =========================================================================
   App main area
   ========================================================================= */
.app-main {
  padding: 20px 16px;
  padding-bottom: calc(var(--nav-h) + 32px);
  max-width: 720px;
  margin: 0 auto;
}
.app-main.on-dark {
  background: var(--green);
  color: rgba(255,255,255,0.92);
  min-height: calc(100vh - var(--header-h));
}
.app-main.on-dark a { color: var(--gold); }

/* =========================================================================
   Bottom nav (mirrors production)
   ========================================================================= */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid rgba(0,0,0,0.08);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.bottom-nav.on-dark {
  background: rgba(6, 30, 22, 0.97);
  border-top-color: rgba(255,255,255,0.08);
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.bottom-nav.on-dark .bn-item { color: rgba(255,255,255,0.6); }
.bn-item.active { color: var(--green-2); }
.bottom-nav.on-dark .bn-item.active { color: var(--gold); }
.bn-icon { width: 22px; height: 22px; display: inline-block; }

/* =========================================================================
   Card system
   ========================================================================= */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.card.on-dark {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
}
.card-eyebrow {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 700;
  margin-bottom: 8px;
}
.card-eyebrow.on-dark { color: var(--gold); }
.card h2, .card .h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--green-2);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  line-height: 1.25;
}
.card.on-dark h2, .card.on-dark .h2 { color: #fff; }
.card h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--green-2);
  margin: 16px 0 6px;
}
.card.on-dark h3 { color: #fff; }
.card p { color: var(--ink); margin-bottom: 10px; }
.card.on-dark p { color: rgba(255,255,255,0.88); }
.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }

/* Variants */
.card.warn  { background: var(--warn-bg); border-color: #e7c79a; }
.card.warn .card-eyebrow { color: var(--warn); }
.card.info  { background: #ecf2ef; border-color: #c7d8d0; }
.card.cream { background: var(--cream-2); border-color: var(--border); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 22px;
  border: 0; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none;
  letter-spacing: 0.2px;
  transition: background 150ms ease-out;
}
.btn-primary { background: var(--green-2); color: #fff; }
.btn-primary:hover { background: var(--green-3); }
.btn-gold { background: var(--gold); color: var(--green-2); }
.btn-gold:hover { background: #d9bb7c; }
.btn-ghost {
  background: transparent; color: var(--green-2);
  border: 1px solid var(--green-2);
}
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-block { width: 100%; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 61, 46, 0.08);
  color: var(--green-2);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
}
.chip.gold { background: rgba(201, 169, 97, 0.18); color: var(--gold-2); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.muted { background: rgba(0,0,0,0.05); color: var(--muted); }
.chip.outline { background: transparent; border: 1px solid var(--gold); color: var(--gold-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* Status pill (for ritual cards: Rukn / Wajib / Sunnah / Custom) */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.status-pill.rukn   { background: #d8e6df; color: #0f5c3f; }
.status-pill.wajib  { background: #d8e6df; color: #0f5c3f; }
.status-pill.sunnah { background: #f3e7c5; color: #8b6f2e; }
.status-pill.custom { background: #ececec; color: #777; }

/* =========================================================================
   Counter visual (jamarat / tawaaf style)
   ========================================================================= */
.counter-stage {
  background: var(--green);
  color: #fff;
  border-radius: 18px;
  padding: 32px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.counter-stage::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(201,169,97,0.10), transparent 60%);
  pointer-events: none;
}
.counter-rings { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.counter-rings .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(201,169,97,0.16);
}
.counter-rings .ring.r2 { inset: 18px; }
.counter-rings .ring.r3 { inset: 36px; }
.counter-rings .ring.r4 { inset: 54px; }
.counter-rings .ring.r5 { inset: 72px; border: 2px solid rgba(201,169,97,0.42); }
.counter-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.counter-num .big {
  font-family: 'Fraunces', serif; font-weight: 600;
  font-size: 76px; line-height: 1; color: var(--gold);
  letter-spacing: -2px;
}
.counter-num .of {
  font-size: 11px; color: rgba(255,255,255,0.55);
  letter-spacing: 2px; text-transform: uppercase; margin-top: 4px;
  font-weight: 600;
}
.counter-strip {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 22px;
}
.counter-strip .pip {
  width: 26px; height: 4px; border-radius: 2px;
  background: rgba(201,169,97,0.22);
}
.counter-strip .pip.done { background: var(--gold); }
.counter-actions {
  display: flex; gap: 10px; justify-content: center; margin-top: 20px;
}

/* =========================================================================
   Lists
   ========================================================================= */
ul.tight, ol.tight { padding-left: 22px; }
ul.tight li, ol.tight li { margin-bottom: 6px; }
ul.tick { list-style: none; padding: 0; }
ul.tick li {
  position: relative;
  padding: 8px 0 8px 30px;
  border-bottom: 1px solid rgba(15,61,46,0.06);
}
ul.tick li:last-child { border-bottom: 0; }
ul.tick li::before {
  content: '✓'; position: absolute; left: 4px; top: 8px;
  color: var(--gold); font-weight: 700;
}

/* =========================================================================
   Note + callout
   ========================================================================= */
.callout {
  border-left: 3px solid var(--gold);
  background: var(--cream-2);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 14px 0;
  font-size: 14px;
}
.callout strong { color: var(--green-2); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }

/* =========================================================================
   Section spacing
   ========================================================================= */
section { margin-bottom: 32px; }
.section-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 700;
  margin-bottom: 10px;
}
.section-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--green-2);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* =========================================================================
   Inline previews on landing page
   ========================================================================= */
.mock-frame {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 28px rgba(0,0,0,0.06);
}
.mock-frame .frame-bar {
  background: var(--cream-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.4px;
  font-family: 'SF Mono', monospace;
}
.mock-frame .frame-body { padding: 18px 16px; }
.mock-frame.dark { background: var(--green); color: rgba(255,255,255,0.9); }
.mock-frame.dark .frame-bar { background: var(--green-4); color: rgba(255,255,255,0.45); border-color: rgba(255,255,255,0.08); }
.mock-frame.dark h3 { color: #fff; }

/* Two-up grid for compare/options */
.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 14px 0;
}
@media (max-width: 640px) {
  .two-up { grid-template-columns: 1fr; }
}

/* =========================================================================
   Tahajjud / amber night theme — class applied at <body> level
   ========================================================================= */
body.tahajjud {
  background: #1a1410;
  color: #d6b87a;
}
body.tahajjud .app-header {
  background: rgba(26, 20, 16, 0.95);
  border-bottom-color: rgba(214, 184, 122, 0.12);
}
body.tahajjud .app-header .logo,
body.tahajjud .app-header .header-title,
body.tahajjud .app-header .app-header-link { color: #d6b87a; }
body.tahajjud .app-header .hijri { color: #b08e54; }
body.tahajjud .card {
  background: #221a14;
  border-color: rgba(214, 184, 122, 0.14);
  color: #d6b87a;
}
body.tahajjud .card h2, body.tahajjud .card h3, body.tahajjud .card .h2 { color: #e5c993; }
body.tahajjud .card-eyebrow { color: #b08e54; }
body.tahajjud .bottom-nav {
  background: rgba(26, 20, 16, 0.96);
  border-top-color: rgba(214, 184, 122, 0.12);
}
body.tahajjud .bn-item { color: #8a7048; }
body.tahajjud .bn-item.active { color: #d6b87a; }
body.tahajjud .btn-primary { background: #4a3a26; color: #e5c993; }
body.tahajjud .btn-gold { background: #6a5435; color: #f0d5a0; }

/* Full dark mode — class applied at <body> level */
body.dark {
  background: var(--green);
  color: rgba(255,255,255,0.92);
}
body.dark .app-header {
  background: rgba(10,46,34,0.95);
  border-bottom-color: rgba(255,255,255,0.08);
}
body.dark .app-header .logo,
body.dark .app-header .header-title,
body.dark .app-header .app-header-link { color: #fff; }
body.dark .app-header .hijri { color: var(--gold); }
body.dark .card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
}
body.dark .card h2, body.dark .card h3, body.dark .card .h2 { color: #fff; }
body.dark .card-eyebrow { color: var(--gold); }
body.dark .bottom-nav {
  background: rgba(6,30,22,0.97);
  border-top-color: rgba(255,255,255,0.08);
}
body.dark .bn-item { color: rgba(255,255,255,0.55); }
body.dark .bn-item.active { color: var(--gold); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile / desktop adjustments */
@media (min-width: 768px) {
  .app-main { padding: 32px 24px; padding-bottom: calc(var(--nav-h) + 48px); }
}
