/* =========================
   JustHelpMe — styles.css
   Shared UI for all pages
========================= */

:root{
  --blue:#0ea5e9;
  --green:#22c55e;
  --text:#0f172a;
  --muted:#475569;
  --bg:#f6f9ff;
  --card:#ffffff;
  --line: rgba(15,23,42,.10);
  --shadow: 0 18px 55px rgba(15,23,42,.10);
  --radius: 18px;

  --ok:#16a34a;
  --bad:#ef4444;
  --warn:#f59e0b;

  --topbarH: 74px;
  --footbarH: 76px;
}

html[data-theme="dark"]{
  --bg:#070a14;
  --card: rgba(11,16,34,1);
  --text:#eef2ff;
  --muted: rgba(238,242,255,.78);
  --line: rgba(255,255,255,.12);
  --shadow: 0 26px 80px rgba(0,0,0,.50);
  
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

/* ===== Layout helpers ===== */
.container{width:min(980px, 100%); margin:0 auto; padding:0 14px;}
.page{
  padding-top: calc(var(--topbarH) + 14px);
  padding-bottom: calc(var(--footbarH) + 14px);
}
.space{height:14px}
.hr{height:1px;background:var(--line);margin:14px 0}
.muted{color:var(--muted)}
.center{text-align:center}
.w100{width:100%}
.hide{display:none !important}

/* ===== Topbar ===== */
.topbar{
  position:fixed; top:0; left:0; right:0;
  height: var(--topbarH);
  z-index: 50;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="dark"] .topbar{
  background: rgba(10,14,28,.70);
}
.topbarInner{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 14px;
  max-width: 980px;
  margin:0 auto;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}
.logo{
  width:42px; height:42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  color:#fff;
  background: linear-gradient(135deg,var(--blue),var(--green));
  box-shadow: 0 10px 25px rgba(14,165,233,.25);
}
.brandText{min-width:0}
.brandText b{
  display:block;
  font-weight:900;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brandText small{
  display:block;
  color: var(--muted);
  font-size: 12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.topActions{display:flex; align-items:center; gap:8px}
.iconBtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.65);
  color: var(--text);
  width:42px; height:42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow: 0 10px 25px rgba(15,23,42,.06);
}
html[data-theme="dark"] .iconBtn{
  background: rgba(255,255,255,.08);
}
.iconBtn:active{transform: scale(.98)}

/* ===== Drawer ===== */
.drawerBackdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease;
  z-index: 60;
}
.drawer{
  position:fixed;
  top: 10px;
  right: 10px;
  width: min(360px, calc(100% - 20px));
  height: calc(100vh - 20px);
  background: var(--card);
  border:1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform .22s ease;
  z-index: 61;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.drawerHead{
  padding:14px 14px 10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.drawerTitle{
  display:flex;
  align-items:center;
  gap:10px;
}
.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  color: var(--muted);
}
.drawerBody{padding:10px 10px; overflow:auto}
.drawerLink{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius: 16px;
  border:1px solid transparent;
  color: var(--text);
}
.drawerLink:hover{
  border-color: var(--line);
  background: rgba(14,165,233,.06);
}
.drawerFoot{
  margin-top:auto;
  padding:12px 14px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  color: var(--muted);
  font-size:12px;
}

/* open drawer */
body.drawerOpen .drawerBackdrop{opacity:1; pointer-events:auto}
body.drawerOpen .drawer{transform: translateX(0)}

/* ===== Footer bar ===== */
.footbar{
  position:fixed;
  left:0; right:0; bottom:0;
  height: var(--footbarH);
  z-index: 40;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px);
  border-top:1px solid var(--line);
}
html[data-theme="dark"] .footbar{
  background: rgba(10,14,28,.70);
}
.footbarInner{
  max-width: 980px;
  margin:0 auto;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-around;
  padding: 8px 10px;
}
.footItem{
  width: 33.33%;
  text-align:center;
  padding: 10px 6px;
  border-radius: 16px;
  color: var(--muted);
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:center;
  justify-content:center;
}
.footItem i{font-size:18px}
.footItem span{font-size:12px}
.footItem.active{
  color: var(--text);
  background: rgba(34,197,94,.10);
  border: 1px solid rgba(34,197,94,.25);
}

/* ===== Cards ===== */
.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card.soft{
  box-shadow:none;
  background: rgba(255,255,255,.55);
}
html[data-theme="dark"] .card.soft{
  background: rgba(255,255,255,.06);
}
.cardTitle{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.cardTitle h2{
  margin:0;
  font-size:16px;
  font-weight:900;
  letter-spacing:.2px;
}
.cardTitle h2 i{color: var(--blue)}

/* ===== Buttons ===== */
.btn{
  border:none;
  cursor:pointer;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight:850;
  color:#fff;
  background: linear-gradient(135deg,var(--blue),var(--green));
  box-shadow: 0 14px 35px rgba(34,197,94,.18);
}
.btn:disabled{opacity:.6; cursor:not-allowed}
.btn:active{transform: scale(.99)}
.btn.small{padding:9px 12px; border-radius: 14px; font-size:13px}
.btn.secondary{
  background: transparent;
  color: var(--text);
  border:1px solid var(--line);
  box-shadow:none;
}
.btn.danger{
  background: linear-gradient(135deg,#ef4444,#f97316);
}

/* ===== Form ===== */
.field{display:flex; flex-direction:column; gap:7px}
label{font-weight:750; font-size:13px; color: var(--muted)}
.input, select, textarea, input[type="date"]{
  width:100%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  color: var(--text);
  outline:none;
}
html[data-theme="dark"] .input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="date"]{
  background: rgba(255,255,255,.08);
}
textarea{min-height: 92px; resize: vertical}

.help{
  font-size:12px;
  color: var(--muted);
  line-height:1.5;
}

.formGrid{display:grid; gap:12px}
.formGrid.two{grid-template-columns: 1fr}
@media (min-width: 760px){
  .formGrid.two{grid-template-columns: 1fr 1fr}
}

/* ===== Pills / rows ===== */
.row{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.55);
  color: var(--text);
  font-size:13px;
}
html[data-theme="dark"] .pill{background: rgba(255,255,255,.07)}

.statusPill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  font-size:13px;
}
.statusPill.pending{background: rgba(245,158,11,.12)}
.statusPill.confirmed{background: rgba(34,197,94,.14)}
.statusPill.cancelled{background: rgba(239,68,68,.14)}
.statusPill i{font-size:10px}

/* Badges */
.badgeOk{
  display:inline-block;
  padding:6px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,.15);
  border:1px solid rgba(34,197,94,.25);
}
.badgeBad{
  display:inline-block;
  padding:6px 10px;
  border-radius: 999px;
  background: rgba(239,68,68,.14);
  border:1px solid rgba(239,68,68,.25);
}

/* ===== Booking stage ===== */
.centerStage{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: calc(100vh - var(--topbarH) - var(--footbarH) - 28px);
}
.stageCard{
  width: 100%;
  max-width: 820px;
  max-height: calc(100vh - var(--topbarH) - var(--footbarH) - 28px);
  overflow:auto;
}
.stageRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Slots grid */
.slotsGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top: 12px;
}
@media (min-width: 520px){
  .slotsGrid{grid-template-columns: 1fr 1fr}
}
.slot{
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:850;
}
.slot.ok{
  cursor:pointer;
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.25);
}
.slot.ok:hover{background: rgba(34,197,94,.16)}
.slot.bad{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.20);
  color: var(--muted);
}

/* ===== Modals ===== */
.modalBack{
  position:fixed; inset:0;
  background: rgba(0,0,0,.42);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease;
  z-index: 80;
}
.modal{
  position:fixed;
  left:50%;
  top:50%;
  transform: translate(-50%,-46%) scale(.98);
  width: min(760px, calc(100% - 18px));
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 81;
}
.modalBack.show{opacity:1; pointer-events:auto}
.modal.show{
  opacity:1;
  pointer-events:auto;
  transform: translate(-50%,-50%) scale(1);
}
.modalCard{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px;
  overflow:hidden;
}
.modalTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom: 10px;
  border-bottom:1px solid var(--line);
}
.xBtn{
  width:40px; height:40px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: transparent;
  cursor:pointer;
  display:grid;
  place-items:center;
}

/* ===== Small polish ===== */
@media (max-width: 380px){
  .brandText small{display:none}
}
/* ===============================
   Service provided pills (✔ tick)
   Same meaning as available rota slot
================================ */

.servicePill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: var(--ok);
  border: 1px solid rgba(34,197,94,.35);
  background: rgba(34,197,94,.12);
}

.servicePill i{
  font-size: 14px;
  color: var(--ok);
}

html[data-theme="dark"] .servicePill{
  color: #dcfce7;
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.18);
}

html[data-theme="dark"] .servicePill i{
  color: #bbf7d0;
}