:root {
  --bg: #0f1419;
  --card: #15202b;
  --muted: #8899a6;
  --text: #e6ecf0;
  --accent: #1d9bf0;
  --accent-2: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 14px;
}
* { box-sizing:border-box; }
body {
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
}
a { color: var(--accent); text-decoration: none; }

/* ---------- Header / Nav ---------- */
.topbar {
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid #1e2732;
  backdrop-filter: blur(8px);
  background:rgba(15,20,25,0.75);
}
.brand { font-weight:800; letter-spacing:.3px; }
.nav a { margin-left:10px; }
.btn {
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid #2b3a47;
  padding:8px 12px;
  border-radius:999px;
  color:#e6ecf0;
  transition: .15s transform, .15s background;
  background:#0b1117;
}
.btn:hover { transform: translateY(-1px); background:#0e1620; }
.btn-primary { background: var(--accent); color:#00131f; border-color:transparent; }
.btn-danger { background: var(--danger); border-color:transparent; color:#fff; }

/* ---------- Layout ---------- */
.container {
  max-width:980px; margin:0 auto;
  display:grid; grid-template-columns: 1fr 600px 1fr; gap:16px; padding:16px;
}
.sidebar { position:sticky; top:68px; height: fit-content; }
.card {
  background:var(--card);
  border:1px solid #1e2732;
  border-radius:var(--radius);
}
.hero { padding:28px; text-align:center; }
.hero h1 { margin:0 0 10px; font-size:28px; }
.hero p { color:var(--muted); }
.cta { display:flex; gap:10px; justify-content:center; margin-top:14px; }

/* ---------- Feed ---------- */
.feed { display:flex; flex-direction:column; }
.tweet {
  display:grid; grid-template-columns: 56px 1fr; gap:12px;
  padding:16px; border-bottom:1px solid #1e2732;
}

/* ---------- Avatar with initials ---------- */
.avatar {
  width:48px; height:48px;
  border-radius:50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:20px;
  text-transform:uppercase;
  user-select:none;
}
.comment .avatar {
  width:40px; height:40px;
  font-size:16px;
}

/* ---------- Tweet content ---------- */
.tweet .meta { font-weight:600; }
.tweet .time { color:var(--muted); font-weight:400; margin-left:6px; }
.tweet img { width:100%; border-radius:12px; border:1px solid #223040; }
.actions { display:flex; gap:16px; margin-top:8px; color:var(--muted); }
.action { cursor:pointer; border-radius:999px; padding:6px 10px; }
.action:hover { background:#0b1117; }

/* ---------- Forms ---------- */
.searchbar, .composer { padding:16px; display:flex; flex-direction:column; gap:10px; }
.input, .select, .search {
  width:100%; padding:10px 12px;
  background:#0b1117; border:1px solid #233041; border-radius:12px;
  color:var(--text);
}
.grid-gifs {
  display:grid; grid-template-columns: repeat(3, 1fr); gap:8px;
  max-height:220px; overflow:auto;
  border:1px solid #1e2732; border-radius:12px; padding:8px;
}
.grid-gifs img { width:100%; border-radius:10px; cursor:pointer; }
.small { font-size:12px; color:var(--muted); }

/* ---------- Footer ---------- */
.footer {
  max-width:980px; margin:20px auto; padding:20px;
  text-align:center; color:var(--muted);
}

/* ---------- Auth Forms ---------- */
.form { display:flex; flex-direction:column; gap:10px; padding:24px; }
.form .row { display:flex; gap:10px; }
.form .row > * { flex:1; }
.input:focus { outline:2px solid var(--accent-2); border-color:transparent; }
.card-title { padding:14px 16px; border-bottom:1px solid #1e2732; font-weight:700; }
.alert { padding:10px 12px; border-radius:10px; border:1px solid #254051; background:#0b151e; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position:fixed; inset:0; background:rgba(0,0,0,.6);
  display:none; align-items:center; justify-content:center; z-index:100;
}
.modal {
  width:min(620px, 92vw); max-height:80vh; overflow:hidden;
  background:var(--card); border:1px solid #1e2732; border-radius:16px;
  display:flex; flex-direction:column;
}
.modal-header {
  padding:12px 14px; border-bottom:1px solid #1e2732;
  display:flex; justify-content:space-between; align-items:center;
}
.modal-body { padding:12px; overflow:auto; }
.comment {
  display:grid; grid-template-columns: 40px 1fr; gap:8px;
  padding:8px 0; border-bottom:1px solid #1e2732;
}
.form-inline { display:flex; gap:8px; margin-top:8px; }
.badge {
  padding:2px 8px; border-radius:999px;
  background:#0b1117; color:var(--muted); border:1px solid #223040;
  font-size:12px;
}

/* Username link styling */
.user-link {
  font-weight: 700;
  color: #e6ecf0;
}
.user-link:hover { text-decoration: underline; }

/* Profile page layout */
.profile-header { display:flex; align-items:center; gap:12px; padding:16px; }
.profile-name { font-size:22px; font-weight:800; }
.info-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
}
.info-box {
  background:#0b1117;
  border:1px solid #233041;
  border-radius:12px;
  padding:12px;
}
.section { padding:16px; }
.section h2 { margin:0 0 10px; }

/* Profile edit modal */
.profile-backdrop {
  position:fixed; inset:0; background:rgba(0,0,0,.6);
  display:none; align-items:center; justify-content:center; z-index:120;
}
.profile-modal {
  width:min(720px, 94vw); max-height:85vh; overflow:auto;
  background:var(--card); border:1px solid #1e2732; border-radius:16px;
  display:flex; flex-direction:column;
}
.profile-modal .modal-header {
  padding:12px 14px; border-bottom:1px solid #1e2732;
  display:flex; justify-content:space-between; align-items:center;
}
.profile-modal .modal-body { padding:14px; display:flex; flex-direction:column; gap:10px; }

.profile-form .row { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.profile-form textarea { min-height:90px; }
.profile-form .full { grid-column: 1 / -1; }

/* Modern dropdown & date look piggyback on existing .input */
.select-modern, .date-modern {
  width:100%; padding:10px 12px;
  background:#0b1117; border:1px solid #233041; border-radius:12px; color:var(--text);
}
.select-modern:focus, .date-modern:focus { outline:2px solid var(--accent-2); border-color:transparent; }

/* Members search dropdown uses existing .card look */
#suggestions .action:hover { background:#0e1620; cursor:pointer; }

/* ---- Connections section on profile ---- */
.tabbar {
  display:flex; gap:8px; margin:8px 0 12px;
}
.tabbar .tab {
  border:1px solid #233041; background:#0b1117; border-radius:999px;
  padding:6px 12px; cursor:pointer;
}
.tabbar .tab.active { background:var(--accent); color:#00131f; border-color:transparent; }

.connections-grid {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:12px;
}
.connection-card {
  display:grid; grid-template-columns: 48px 1fr auto; align-items:center;
  gap:10px; padding:10px 12px;
  background:#0b1117; border:1px solid #233041; border-radius:12px;
}
.connection-card .avatar { width:40px; height:40px; font-size:16px; }
.connection-meta { display:flex; flex-direction:column; }
.connection-meta .name { font-weight:700; }
.connection-meta .muted { font-size:12px; color:var(--muted); }

.action { cursor:pointer; border-radius:999px; padding:6px 10px; }
.action:hover { background:#0b1117; }

/* Facebook share button */
.fb-share{
  display:flex; align-items:center; justify-content:center; gap:10px;
  margin-top:12px; padding:12px 16px;
  border:0; border-radius:999px;
  background: linear-gradient(135deg, #1877F2, #00A3FF);
  color:#fff; font-weight:800; text-decoration:none;
  box-shadow: 0 8px 20px rgba(24,119,242,.35), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.fb-share:hover{ transform: translateY(-1px); box-shadow: 0 12px 28px rgba(24,119,242,.45); filter: saturate(1.1); }
.fb-share:active{ transform: translateY(0); }

.fb-logo{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:6px;
  background:#fff; color:#1877F2; font-weight:900; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* --- How it works floating button --- */
.howitworks-btn{
  position: fixed; left: 24px; bottom: 24px; z-index: 320;
  padding: 10px 14px; border-radius: 999px; border: 1px solid #2a3a4a;
  background: linear-gradient(135deg, var(--accent, #1da1f2), #33bbff);
  color: #00131f; font-weight: 800; box-shadow: 0 10px 24px rgba(29,161,242,.35), inset 0 1px 0 rgba(255,255,255,.18);
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.howitworks-btn:hover{ transform: translateY(-1px); box-shadow: 0 14px 30px rgba(29,161,242,.45); filter: saturate(1.05); }
.howitworks-btn:active{ transform: translateY(0); }

/* --- Modal --- */
.how-backdrop{
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center;
}
.how-modal{
  position: relative; width: min(900px, 92vw);
  background: var(--card, #0b1117); border: 1px solid #233041; border-radius: 16px;
  padding: 8px 8px 12px; box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.how-modal video{ width: 100%; height: auto; border-radius: 12px; display: block; background:#000; }

/* close button */
.how-close{
  position: absolute; right: 8px; top: 8px; width: 36px; height: 36px;
  border-radius: 999px; border: 1px solid #233041;
  background:#0e1620; color: var(--text, #e6eef5); font-size: 20px; line-height: 1;
  cursor: pointer; transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.how-close:hover{ transform: translateY(-1px); background:#101a24; border-color:#374a60; }

/* keep it tidy on very small screens */
@media (max-width: 520px){
  .howitworks-btn{ left: 16px; bottom: 16px; }
}
