/* ==========================================================================
   MyINC Social — app.css (CLEAN)
   Mobile-first, Facebook-clean.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root{
  --bg:#f0f2f5;
  --card:#ffffff;
  --text:#1c1e21;
  --muted:#65676b;

  --blue:#1877f2;
  --blue2:#0f63d6;

  --line:#dadde1;
  --radius:14px;
  --shadow:0 6px 18px rgba(0,0,0,.06);

  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* ---------- Reset / base ---------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  -webkit-text-size-adjust:100%;
  font-size:15px;
  line-height:1.45;
}
a{color:inherit}
img{max-width:100%;height:auto;display:block}
button,input,textarea,select{font:inherit}
::selection{background:rgba(24,119,242,.18)}

/* Utility */
.hidden{display:none !important}
.muted{color:var(--muted)}
.hr{height:1px;background:var(--line);border:0;margin:12px 0}
.container{max-width:980px;margin:0 auto;padding:16px 14px}

/* ---------- Cards ---------- */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.pad{padding:16px}
.card + .card{margin-top:12px}

/* ---------- Buttons ---------- */
.btn{
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:12px 12px;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  color:var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:15px;
}
.btn:hover{filter:brightness(.98)}
.btn:active{transform:translateY(1px)}
.btnPrimary{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff;
}
.btnPrimary:hover{background:var(--blue2);border-color:var(--blue2)}
.btnDanger{
  background:#ffeded;
  border-color:#ffc9c9;
  color:#b42318;
}
.btnSmall{padding:9px 10px;border-radius:10px;font-weight:800;font-size:14px}

/* ---------- Inputs ---------- */
.input, input[type="text"], input[type="email"], input[type="password"], textarea, select{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:12px 12px;
  outline:none;
}
.input:focus, input:focus, textarea:focus, select:focus{
  border-color:rgba(24,119,242,.55);
  box-shadow:0 0 0 3px rgba(24,119,242,.14);
}
.label{font-size:12px;color:var(--muted);font-weight:800;margin:0 0 6px}

/* ==========================================================================
   HEADER (shared across app pages)
   ========================================================================== */

header{
  position:sticky;
  top:0;
  z-index:1000;
  background:var(--card);
  border-bottom:1px solid var(--line);
}

/* Top row: brand + profile */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  padding-top:max(12px, env(safe-area-inset-top));
}

/* ✅ Match your reference: smaller brand */
.brand{
  font-size:26px;
  font-weight:900;
  letter-spacing:-0.3px;
  text-decoration:none;
  line-height:1.05;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Profile chip */
.profileWrap{
  position:relative;
  flex:0 0 auto;
}
.profileChip,
.profileBtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:9px 10px; /* ✅ slightly smaller */
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.05);
  -webkit-tap-highlight-color:transparent;
}
.profileChip:active,
.profileBtn:active{transform:translateY(1px)}
.avatar{
  width:34px;height:34px; /* ✅ slightly smaller */
  border-radius:999px;
  display:grid;place-items:center;
  background:rgba(24,119,242,.10);
  color:var(--blue);
  font-weight:1000;
  letter-spacing:-0.2px;
  font-size:14px;
}
.caret{
  width:0;height:0;
  border-left:6px solid transparent;
  border-right:6px solid transparent;
  border-top:7px solid var(--muted);
  opacity:.85;
}

/* Dropdown menu */
.menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:190px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.12);
  padding:8px;
  display:none;
}
.menu.open{display:block}
.menu a,
.menu button{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  text-decoration:none;
  color:var(--text);
  border:0;
  background:transparent;
  cursor:pointer;
  font-weight:800;
}
.menu a:hover,
.menu button:hover{background:rgba(0,0,0,.05)}
.menu .danger{
  color:#b42318;
  background:rgba(255,0,0,.03);
}
.menu .danger:hover{background:rgba(255,0,0,.08)}

/* Nav tabs row */
.nav{
  padding:10px 14px 12px;
  padding-bottom:max(12px, env(safe-area-inset-bottom));
  display:flex;
  justify-content:center;
}

.tabs{
  background:rgba(0,0,0,.04);
  border:1px solid rgba(0,0,0,.06);
  border-radius:999px;
  padding:6px;
  display:flex;
  gap:6px;
  max-width:640px; /* ✅ slightly tighter */
  width:100%;
  justify-content:space-between;
}

/* ✅ Match your reference: smaller tab type */
.tab{
  flex:1 1 0;
  text-align:center;
  padding:10px 12px;
  border-radius:999px;
  text-decoration:none;
  font-weight:900;
  font-size:15px;
  color:var(--muted);
  letter-spacing:-0.2px;
}
.tab:hover{background:rgba(0,0,0,.04)}
.tab.active,
.tab[aria-current="page"]{
  background:rgba(24,119,242,.10);
  color:var(--blue);
}

/* Desktop: don’t over-wide the pill */
@media (min-width:860px){
  .tabs{width:auto;min-width:560px}
}

/* ==========================================================================
   Page patterns
   ========================================================================== */
.h1{margin:0;font-size:18px;letter-spacing:-0.2px;font-weight:1000}
.h2{margin:0;font-size:16px;letter-spacing:-0.1px;font-weight:1000}
.p{margin:8px 0 0;color:var(--muted);font-size:13px;line-height:1.45}

/* Simple list rows */
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.stack{display:flex;flex-direction:column;gap:10px}

/* Pill */
.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:8px 10px;
  font-weight:900;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}

/* Safety: prevent horizontal scroll bugs */
html,body{overflow-x:hidden}
main{overflow-x:hidden}

/* Small screens tuning */
@media (max-width:520px){
  .brand{font-size:24px}
  .tab{padding:10px 8px}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important; transition:none !important; animation:none !important}
}
