/* ═══════════════════════════════════════════════════════
   wireframe-base.css — ResearchMate Wireframe Shared Base
   Included by all wireframe pages.
   ═══════════════════════════════════════════════════════ */

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

/* Zoom-proof full-height anchor: % chains beat vh under css zoom */
html,body{height:100%}

/* ── CSS Variables ── */
:root{
  --orange:#EB5D2F; --od:#C74720; --ol:#FEF1EC; --om:#FAB195;
  --teal:#3EB1C8;   --tl:#EAF7FB; --gold:#FFC72C; --gl:#FFFBEB;
  --brown:#584446;  --bd:#261D1E; --bm:#8A838E;
  --silver:#E5E1E6; --sl:#F8F6F9; --border:#EDE9EE;
  --r-sm:8px; --r-md:12px; --r-lg:14px; --r-xl:20px;
  /* Surfaces + status tints. Light values are the exact colours pages used before;
     the dark theme at the end of this file redefines them. */
  --card:#fff; --page:#F6F4F7; --ink:#261D1E; --ink2:#584446; --ol2:#FFF3EE;
  --muted:#A9A2AD; --faint:#C8C2CB;
  --td:#1C6574; --gd:#B38009; --gb:#FFE67B;
  --okl:#f0fdf4; --okd:#166534; --okb:#bbf7d0;
  color-scheme:light;
}

/* ══════════════════════════════════════
   LEFT SIDEBAR
   Used by: 10-my-projects, 12-project-activity, 13-task-details
   ══════════════════════════════════════ */
.sidebar{
  width:220px; flex-shrink:0; background:var(--card);
  background:linear-gradient(180deg, var(--card) 0%, var(--card) 30%,
             color-mix(in srgb, var(--orange) 9%, var(--card)) 100%);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column;
  overflow:hidden; height:100%;
  transition:transform .28s cubic-bezier(.4,0,.2,1), width .25s ease, min-width .25s ease;
  z-index:80;
}
/* nav scrolls on its own; header + user/sign-out stay pinned */
.sb-nav{flex:1; overflow-y:auto; min-height:0; scrollbar-width:thin; scrollbar-color:var(--border) transparent}
.sb-collapse{
  width:26px; height:26px; border-radius:7px; border:none; background:var(--sl);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  color:var(--bm); transition:.15s; flex-shrink:0;
}
.sb-collapse:hover{background:var(--ol); color:var(--orange)}
.sb-reveal{
  display:none; position:fixed; top:12px; left:12px; z-index:75;
  width:34px; height:34px; border-radius:9px; border:1px solid var(--border);
  background:var(--card); cursor:pointer; align-items:center; justify-content:center;
  color:var(--bm); box-shadow:0 2px 10px rgba(88,68,70,.12); transition:.15s;
}
.sb-reveal:hover{color:var(--orange); border-color:var(--orange)}
/* Desktop collapse */
@media(min-width:821px){
  body.sb-hidden .sidebar{
    width:0; min-width:0; border-right:none;
    visibility:hidden; overflow:hidden; padding:0;
  }
  body.sb-hidden .sb-reveal{display:flex}
  /* keep page titles clear of the floating reveal button */
  body.sb-hidden .main > .topbar{padding-left:56px !important}
}
.sb-header{
  padding:14px 10px 12px; border-bottom:1px solid var(--border);
  margin-bottom:6px; display:flex; align-items:center;
  justify-content:space-between; gap:8px; flex-shrink:0;
}
.sb-logo-left{display:flex; align-items:center; gap:8px}
.sb-logo-mark{
  width:28px; height:28px; background:var(--orange); border-radius:7px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.sb-brand{font-size:14px; font-weight:800; color:var(--orange)}
.sb-close{
  display:none; width:26px; height:26px; border-radius:7px;
  border:none; background:var(--sl); cursor:pointer;
  align-items:center; justify-content:center;
  font-size:16px; color:var(--bm); transition:.15s; flex-shrink:0;
}
.sb-close:hover{background:var(--ol); color:var(--orange)}
.sb-section{
  font-size:9px; font-weight:800; letter-spacing:.12em;
  text-transform:uppercase; color:var(--faint); padding:12px 12px 4px; flex-shrink:0;
}
.sb-item{
  display:flex; align-items:center; gap:8px;
  padding:8px 12px; margin:1px 4px; border-radius:9px;
  font-size:13px; font-weight:600; color:var(--bm);
  cursor:pointer; transition:.15s; text-decoration:none; flex-shrink:0;
}
.sb-item svg{width:15px; height:15px; flex-shrink:0}
.sb-item:hover{background:var(--ol); color:var(--orange)}
.sb-item.on{background:var(--ol); color:var(--orange)}
.sb-badge-pill{
  margin-left:auto; font-size:10px; font-weight:800;
  padding:1px 6px; border-radius:20px; background:var(--orange); color:#fff;
}
.sb-divider{height:1px; background:var(--border); margin:5px 14px}
/* Tools: a collapsible group of smaller links under the main items */
.sb-group-btn{width:calc(100% - 8px); border:none; background:none; font-family:inherit; text-align:left}
/* touch screens keep :hover after a tap — the toggle must not look like the current page */
@media (hover:none){.sb-group-btn:hover{background:none; color:var(--bm)}}
.sb-group-btn .sb-chev{width:13px; height:13px; margin-left:auto; transition:transform .2s}
.sb-group.open .sb-group-btn .sb-chev{transform:rotate(180deg)}
.sb-sub{display:none; position:relative; padding:1px 0 3px}
.sb-group.open .sb-sub{display:block}
.sb-sub::before{content:''; position:absolute; left:23px; top:3px; bottom:6px; width:1.5px; background:var(--border); border-radius:2px}
.sb-subitem{
  display:flex; align-items:center; gap:7px;
  padding:6px 8px 6px 9px; margin:1px 4px 1px 30px; border-radius:8px;
  font-size:11.5px; font-weight:600; color:var(--bm); white-space:nowrap;
  text-decoration:none; transition:.15s;
}
.sb-subitem svg{width:13px; height:13px; flex-shrink:0}
.sb-subitem:hover,.sb-subitem.on{background:var(--ol); color:var(--orange)}
.sb-bottom{
  margin-top:auto; padding:10px 4px 14px;
  border-top:1px solid var(--border); flex-shrink:0;
}
.sb-user{
  display:flex; align-items:center; gap:8px;
  padding:9px 10px; border-radius:9px; cursor:pointer;
}
.sb-user:hover{background:var(--sl)}
.sb-av{
  width:30px; height:30px; border-radius:50%; background:var(--orange);
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:800; color:#fff; flex-shrink:0;
}
.sb-uname{font-size:12px; font-weight:700; color:var(--bd)}
.sb-urole{font-size:10px; color:var(--bm); font-weight:400}

/* ── Sidebar Overlay ── */
#sb-overlay{
  display:none; position:fixed; inset:0;
  background:rgba(38,29,30,.45); z-index:70;
  backdrop-filter:blur(2px); opacity:0; transition:opacity .28s;
}
#sb-overlay.show{display:block; opacity:1}

/* ── Hamburger Button ── */
.ham-btn{
  display:none; width:34px; height:34px; border-radius:8px;
  background:var(--sl); border:none; cursor:pointer;
  align-items:center; justify-content:center;
  flex-direction:column; gap:4px; padding:8px;
  transition:.15s; flex-shrink:0;
}
.ham-btn:hover{background:var(--ol)}
.ham-btn span{
  display:block; height:2px; background:var(--bd);
  border-radius:2px; width:100%; transition:.25s; transform-origin:center;
}
.ham-btn.open span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.ham-btn.open span:nth-child(2){opacity:0; transform:scaleX(0)}
.ham-btn.open span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

/* ══════════════════════════════════════
   RESPONSIVE — Sidebar slide-over (≤ 820px)
   ══════════════════════════════════════ */
@media(max-width:820px){
  .sb-collapse{display:none}
  .sb-reveal{display:none !important}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0;
    transform:translateX(-100%);
    box-shadow:4px 0 24px rgba(38,29,30,.15);
  }
  .sidebar.open{transform:translateX(0)}
  .sb-close{display:flex}
  .ham-btn{display:flex}
  .main{padding-top:54px}
  .topbar{position:fixed; top:0; left:0; right:0; z-index:60; padding:0 14px}
  /* iOS zooms the page when a focused field is under 16px — keep phone inputs at 16px */
  input[type="text"], input[type="email"], input[type="password"], input[type="search"],
  input[type="number"], input:not([type]), textarea, select { font-size:16px !important; }
}

/* ── Global comfort zoom: the wireframe-derived sizes read small on laptop
     screens, so scale the whole UI ~125% on desktop widths. Mobile
     breakpoints (≤900px) are untouched — zoom only kicks in above them. ── */
@media (min-width: 1000px) {
  html { zoom: 1.25; }
}

/* ── Real profile photo inside any initials circle ── */
.av-img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block;flex-shrink:0}

/* ── Tiny inline spinner (AI buttons etc.) ── */
.rm-spin{display:inline-block;width:11px;height:11px;border:2px solid rgba(255,255,255,.35);border-top-color:var(--card);border-radius:50%;animation:rmSpinB .7s linear infinite;flex-shrink:0}
@keyframes rmSpinB{to{transform:rotate(360deg)}}
.rm-loading{display:inline-flex !important;align-items:center;justify-content:center;gap:9px !important}
.rm-loading .rm-spin{width:12px;height:12px;border-color:currentColor;border-top-color:transparent;opacity:.85}

/* ResearchMate AI mascot, used wherever AI features appear */
.rm-ai{display:inline-block;object-fit:contain;flex-shrink:0;vertical-align:middle}
/* Sidebar footer link (Contact us) */
.sb-foot-link{width:100%;display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:9px;font-size:12px;font-weight:600;color:var(--bm);text-decoration:none;transition:.15s;box-sizing:border-box;white-space:nowrap}
.sb-foot-link:hover,.sb-foot-link.on{background:var(--ol);color:var(--orange)}

/* ══════════════════════════════════════════════════════════
   DARK THEME — <html data-theme="dark">, set by the Dark mode
   switch (saved per browser, applied before first paint by the
   script in fragments/head.html). Emails stay light.
   ══════════════════════════════════════════════════════════ */
html[data-theme="dark"]{
  color-scheme:dark;
  --od:#F07A50; --ol:rgba(235,93,47,.15); --om:rgba(235,93,47,.42); --ol2:rgba(235,93,47,.18);
  --teal:#45B8CE; --tl:rgba(62,177,200,.15); --td:#8ADBEA;
  --gl:rgba(255,199,44,.12); --gd:#F2C54F; --gb:rgba(255,199,44,.35);
  --brown:#D6CCD0; --bd:#F2EDEF; --bm:#A69DA3; --muted:#8C8389; --faint:#675E63;
  --silver:#3A3236; --sl:#262024; --border:#352C30;
  --card:#1D1719; --page:#141012; --ink:#2C2326; --ink2:#4A3E42;
  --okl:rgba(34,197,94,.14); --okd:#7BE3A6; --okb:rgba(34,197,94,.35);
  background:#141012;
}
html[data-theme="dark"] body{
  color:var(--bd);
  background:
    radial-gradient(1200px 640px at 92% -10%, rgba(235,93,47,.10), transparent 65%),
    radial-gradient(880px 520px at -10% 106%, rgba(62,177,200,.06), transparent 60%),
    radial-gradient(rgba(255,255,255,.035) 1.05px, transparent 1.45px),
    #141012;
  background-size:auto, auto, 21px 21px, auto;
  background-attachment:fixed;
}
html[data-theme="dark"] img[src$="/img/logo.png"]{content:url('/img/logo-dark.png')}
html[data-theme="dark"] ::selection{background:rgba(235,93,47,.35)}

/* ── Dark mode switch ── */
.theme-switch{width:100%;display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:9px;border:none;background:transparent;font-family:'Plus Jakarta Sans',sans-serif;font-size:12px;font-weight:600;color:var(--bm);cursor:pointer;transition:background .15s,color .15s;text-align:left;box-sizing:border-box}
.theme-switch:hover{background:var(--ol);color:var(--orange)}
.theme-switch .ts-track{margin-left:auto;width:30px;height:17px;border-radius:20px;background:var(--silver);position:relative;flex-shrink:0;transition:background .2s}
.theme-switch .ts-knob{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s}
.theme-switch[aria-checked="true"] .ts-track{background:var(--orange)}
.theme-switch[aria-checked="true"] .ts-knob{transform:translateX(13px)}
.theme-switch .ts-sun{display:none}
html[data-theme="dark"] .theme-switch .ts-moon{display:none}
html[data-theme="dark"] .theme-switch .ts-sun{display:block}
.theme-switch.on-dark{color:rgba(255,255,255,.65);padding:10px 12px}
.theme-switch.on-dark:hover{background:rgba(255,255,255,.06);color:#fff}
.theme-switch.on-dark .ts-track{background:rgba(255,255,255,.18)}
.theme-switch.inline{width:auto;display:inline-flex;padding:4px 6px;font-size:12px;font-weight:500;color:var(--muted)}
.theme-switch.inline:hover{background:transparent;color:var(--orange)}
.theme-switch.on-dark[aria-checked="true"] .ts-track{background:var(--orange)}
/* Fields that set no background of their own match the cards (zero specificity: any page rule wins) */
:where(html[data-theme="dark"]) :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea,select){background-color:var(--card);color:var(--bd)}
/* A number field holding something that isn't a number in range (app.js rmNumberHint) */
.rm-invalid{border-color:#E5484D !important;box-shadow:0 0 0 3px rgba(229,72,77,.12) !important}
.size-ctl:has(.rm-invalid){border-color:#E5484D !important}
.rm-num-hint{font-size:11.5px;font-weight:600;color:#C5282F;margin-top:6px;line-height:1.45}
html[data-theme="dark"] .rm-num-hint{color:#FF8A8F}
