/* ============================================================
   ROCK DID IT™ — IBO Member Hub
   main.css — Primary Stylesheet (Mobile-First)
   ============================================================ */

/* ── CSS VARIABLES (Design Tokens) ── */
:root {
  /* Backgrounds */
  --bg:      #080808;
  --bg2:     #111111;
  --bg3:     #1a1a1a;
  --bg4:     #222222;
  --bg5:     #2a2a2a;

  /* Text */
  --t1:      #ffffff;
  --t2:      #999999;
  --t3:      #555555;

  /* Borders */
  --border:  rgba(255,255,255,0.08);

  /* Brand */
  --gold:    #C9A84C;
  --gold2:   rgba(201,168,76,0.15);
  --green:   #00C864;
  --red:     #EF4444;
  --orange:  #FF6B1A;

  /* Current phase accent — updated by JS */
  --phase-color: #C9A84C;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Spacing */
  --sp:  8px;
  --sp2: 14px;
  --sp3: 20px;

  /* Radius */
  --r:  10px;
  --r2: 14px;
  --r3: 20px;
}

/* ── RESET & BASE ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html,body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, textarea, select {
  font-family: var(--font);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--t1);
  padding: 11px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
input:focus, textarea:focus { border-color: var(--phase-color); }
textarea { resize: none; line-height: 1.6; }

/* ── APP SHELL ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── TOP BAR ── */
#topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(8,8,8,0.97);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  transition: border-color .3s;
}
.tb-brand { display: flex; align-items: center; gap: 8px; }
.tb-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--phase-color);
  color: #000;
  font-weight: 900;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s;
}
.tb-name { font-size: 13px; font-weight: 900; color: var(--phase-color); letter-spacing: .5px; transition: color .3s; }
.tb-tag  { font-size: 9px; color: var(--t2); }
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--phase-color);
  transition: color .3s, border-color .3s;
}
.tb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--phase-color);
  color: #000;
  font-weight: 900;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .3s;
}

/* ── MAIN SCROLL AREA ── */
#screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 100px;
}
#screen::-webkit-scrollbar { display: none; }

/* ── BOTTOM NAV ── */
#nav {
  flex-shrink: 0;
  display: flex;
  background: rgba(8,8,8,0.97);
  border-top: 1px solid var(--border);
  padding: 8px 0 18px;
  transition: border-color .3s;
}
.nb {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nb-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: background .2s, box-shadow .2s;
}
.nb.active .nb-icon {
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 12px rgba(255,255,255,0.05);
}
.nb-lbl {
  font-size: 9px;
  color: var(--t3);
  font-weight: 600;
  transition: color .2s;
}
.nb.active .nb-lbl { color: var(--phase-color); }
.nb-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background .2s;
}
.nb.active .nb-dot { background: var(--phase-color); }

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border-radius: var(--r2);
  border: 1px solid var(--border);
  padding: var(--sp2);
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.card-gold   { border-color: rgba(201,168,76,.3);  background: rgba(201,168,76,.06); }
.card-green  { border-color: rgba(0,200,100,.3);   background: rgba(0,200,100,.06); }
.card-orange { border-color: rgba(255,107,26,.3);  background: rgba(255,107,26,.07); }
.card-purple { border-color: rgba(155,89,182,.3);  background: rgba(155,89,182,.07); }
.card-locked { opacity: .45; pointer-events: none; user-select: none; }
.card-phase  { border-color: rgba(var(--phase-color-rgb),.3); }

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--r);
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity .2s, transform .1s;
}
.btn:active { opacity: .85; transform: scale(.99); }
.btn-gold    { background: var(--gold);    color: #000; }
.btn-outline { background: transparent; border: 1px solid var(--gold); color: var(--gold);
               border-radius: var(--r); padding: 12px; font-size: 14px; font-weight: 700;
               cursor: pointer; font-family: var(--font); width: 100%; margin-top: 8px; display: block; }
.btn-phase   { background: var(--phase-color); color: #000; }
.btn-gray    { background: var(--bg3); color: var(--t2); border: 1px solid var(--border); }
.btn-sm      { display: inline-block; width: auto; padding: 8px 14px; font-size: 12px; border-radius: 8px; }

/* ── STAT ROW ── */
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px; }
.stat-card { background: var(--bg3); border-radius: 10px; padding: 10px 6px; text-align: center; border: 1px solid var(--border); }
.stat-val  { font-size: 18px; font-weight: 900; line-height: 1; }
.stat-lbl  { font-size: 8px; color: var(--t2); margin-top: 3px; text-transform: uppercase; letter-spacing: .3px; }

/* ── PROGRESS BAR ── */
.prog-track { background: var(--bg4); border-radius: 20px; overflow: hidden; }
.prog-fill  { border-radius: 20px; transition: width .5s ease; }

/* ── SEQUENCE STEPS ── */
.seq-step { border-radius: 12px; padding: 14px; margin-bottom: 8px; border: 2px solid var(--border); transition: all .2s; }
.seq-step.active { border-color: var(--phase-color); }
.seq-step.complete { border-color: var(--green); background: rgba(0,200,100,.05); }
.seq-step.locked-seq { opacity: .45; pointer-events: none; }
.seq-connector { width: 2px; height: 16px; margin: 0 auto; background: var(--border); }
.seq-connector.done { background: var(--green); }

/* ── CHECK CIRCLE ── */
.check-circle {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--t3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}

/* ── TASK ROW ── */
.task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

/* ── TABS ── */
.tab-row { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab-row::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: 55px;
  padding: 9px 4px;
  font-size: 10px; font-weight: 700;
  color: var(--t2);
  background: transparent; border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap; font-family: var(--font);
  transition: all .2s;
}

/* ── PHASE CARDS (journey map) ── */
.phase-card {
  border-radius: var(--r2); padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--border); position: relative;
  transition: all .2s;
}
.phase-card.active { border-width: 2px; }
.phase-card.done   { border-color: rgba(0,200,100,.4); background: rgba(0,200,100,.04); }
.phase-card.locked { opacity: .5; }
.phase-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; flex-shrink: 0;
}

/* ── STAIRCASE ── */
.stair-step { border-radius: 14px; padding: 14px; margin-bottom: 6px; border: 1px solid var(--border); }
.stair-step.done   { border-color: rgba(0,200,100,.5); background: rgba(0,200,100,.04); }
.stair-step.active { border-width: 2px; }
.stair-step.locked { opacity: .4; }
.stair-arrow { text-align: center; font-size: 18px; color: var(--t3); margin: 2px 0; }

/* ── STATUS BADGES ── */
.badge {
  font-size: 10px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid; display: inline-block;
}
.badge-complete  { background: rgba(0,200,100,.15); color: var(--green); border-color: rgba(0,200,100,.3); }
.badge-active    { background: rgba(155,89,182,.15); color: #9B59B6; border-color: rgba(155,89,182,.3); }
.badge-pending   { background: rgba(255,165,0,.15);  color: #FFA500;  border-color: rgba(255,165,0,.3); }
.badge-locked    { background: var(--bg4); color: var(--t3); border-color: var(--border); }
.badge-approved  { background: rgba(0,200,100,.15); color: var(--green); border-color: rgba(0,200,100,.3); }

/* ── CONTACT ROW ── */
.contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent;
  margin-bottom: 5px; background: var(--bg2);
  transition: background .2s;
}
.contact-row:hover { background: var(--bg3); }

/* ── SCRIPTURE CARD ── */
.scripture-card {
  background: rgba(201,168,76,.08);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: var(--r2);
  padding: var(--sp2);
  margin-bottom: 10px;
}

/* ── SOCIAL CONTENT CARD ── */
.content-phase-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: var(--sp2);
  margin-bottom: 8px;
}
.do-tag   { color: var(--green); font-size: 11px; font-weight: 700; }
.dont-tag { color: var(--red);   font-size: 11px; font-weight: 700; }
.content-type-pill {
  background: var(--bg4); border-radius: 20px;
  padding: 4px 10px; font-size: 10px; font-weight: 700;
  color: var(--t2); display: inline-block; margin: 2px;
}

/* ── LOCK REASON ── */
.lock-reason {
  font-size: 10px; color: var(--t3);
  margin-top: 6px; padding: 7px 10px;
  background: var(--bg4); border-radius: 8px;
  border-left: 3px solid var(--t3); line-height: 1.4;
}

/* ── MODAL ── */
#modal {
  display: none;
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 100;
  flex-direction: column;
}
#modal.open { display: flex; }
#modal-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding: 14px 14px 100px;
}

/* ── DRAWER ── */
#drawer {
  position: absolute; bottom: 0; left: 50%; width: 100%; max-width: 430px;
  transform: translateX(-50%) translateY(100%);
  background: var(--bg2);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px 40px;
  border: 1px solid var(--border);
  transition: transform .3s ease;
  z-index: 80;
}
#drawer.open { transform: translateX(-50%) translateY(0); }
.drawer-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 12px; }
.drawer-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 6px;
  cursor: pointer; text-align: center; font-family: var(--font);
  transition: background .2s;
}
.drawer-btn:hover { background: var(--bg4); }

/* ── CELEBRATION ── */
#celeb {
  display: none;
  position: absolute; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
#celeb.open { display: flex; }

/* ── DAY GRID (90-day) ── */
.day-grid { display: grid; grid-template-columns: repeat(10,1fr); gap: 4px; margin-bottom: 12px; }
.day-sq {
  aspect-ratio: 1; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700;
  transition: background .3s;
}

/* ── FILTER CHIPS ── */
.filter-row { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.filter-row::-webkit-scrollbar { display: none; }
.f-chip {
  padding: 6px 13px; border-radius: 20px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border); background: transparent; color: var(--t2);
  cursor: pointer; white-space: nowrap; font-family: var(--font); flex-shrink: 0;
  transition: all .2s;
}
.f-chip.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ── SECTION HEADER ── */
.sec-hdr { margin-bottom: 14px; }
.sec-hdr h2 { font-size: 20px; font-weight: 900; }
.sec-hdr p  { font-size: 13px; color: var(--t2); margin-top: 4px; }

/* ── AVATAR ── */
.avt {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; flex-shrink: 0;
}

/* ── INFO ROW ── */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }

/* ── WEEK DOTS ── */
.week-dots { display: flex; gap: 6px; margin: 8px 0; }
.week-dot  { flex: 1; height: 6px; border-radius: 3px; background: var(--bg4); transition: background .3s; }
.week-dot.done { background: var(--gold); }

/* ── ANIMATIONS ── */
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes fadeIn  { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:.6} }

.animate-bounce { animation: bounce .6s ease both; }
.animate-fade   { animation: fadeIn .3s ease both; }
.animate-pulse  { animation: pulse 2s ease infinite; }

/* ── UTILITY ── */
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 10px; }
.text-lg  { font-size: 18px; }
.text-xl  { font-size: 22px; }
.bold     { font-weight: 700; }
.bolder   { font-weight: 900; }
.gold     { color: var(--gold); }
.green    { color: var(--green); }
.orange   { color: var(--orange); }
.muted    { color: var(--t2); }
.center   { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.hr   { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── RESPONSIVE (tablets/desktop) ── */
@media (min-width: 430px) {
  #app { border-right: 1px solid var(--border); border-left: 1px solid var(--border); }
}
@media (min-width: 768px) {
  body { background: #050505; }
  #app { margin: 0 auto; box-shadow: 0 0 80px rgba(0,0,0,.8); }
}
