/* =============================================================================
   FaceSmash — estilos. Paleta azul del main.css original del curso
   (#005073, #107dac, #189ad3), con diseño de tres columnas y modo oscuro.
   ========================================================================== */
:root {
  --brand: #189ad3;
  --brand-strong: #107dac;
  --brand-deep: #005073;
  --bg: #ffffff;
  --bg-soft: #f4f8fb;
  --bg-hover: rgba(15, 20, 25, .04);
  --line: #e4ebf0;
  --text: #0f1419;
  --muted: #5b7083;
  --like: #f91880;
  --ok: #00ba7c;
  --warn-bg: #fff4e0;
  --warn-text: #8a5a00;
  --ok-bg: #e3f7ee;
  --ok-text: #046c46;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 80, 115, .08);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #2bb0ea; --brand-strong: #58c3f0; --brand-deep: #8fd6f5;
    --bg: #0b1218; --bg-soft: #131d26; --bg-hover: rgba(255, 255, 255, .04);
    --line: #22313d; --text: #e7edf2; --muted: #8b9eae;
    --warn-bg: #3a2a08; --warn-text: #ffd37a; --ok-bg: #0c3325; --ok-text: #7ce3b8;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #2bb0ea; --brand-strong: #58c3f0; --brand-deep: #8fd6f5;
  --bg: #0b1218; --bg-soft: #131d26; --bg-hover: rgba(255, 255, 255, .04);
  --line: #22313d; --text: #e7edf2; --muted: #8b9eae;
  --warn-bg: #3a2a08; --warn-text: #ffd37a; --ok-bg: #0c3325; --ok-text: #7ce3b8;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
}

/* --- General ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.inline { display: inline; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }

/* --- Estructura de tres columnas ---------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 600px) 340px;
  justify-content: center;
  min-height: 100vh;
}
.sidebar-left {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 16px; overflow-y: auto;
}
.main { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; padding-bottom: 80px; }
.sidebar-right { padding: 12px 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Varela Round', 'Inter', sans-serif; font-size: 1.45rem;
  color: var(--brand-deep); padding: 8px 10px; border-radius: 999px; width: max-content;
}
.brand:hover { text-decoration: none; background: var(--bg-hover); }

.mainnav { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; }
.mainnav a {
  display: flex; align-items: center; gap: 16px; position: relative;
  padding: 12px 14px; border-radius: 999px; color: var(--text); font-size: 1.12rem; width: max-content;
}
.mainnav a svg { width: 24px; height: 24px; }
.mainnav a:hover { background: var(--bg-hover); text-decoration: none; }
.mainnav a.current { font-weight: 700; }
.mainnav a.current svg { stroke-width: 3; }
.badge {
  position: absolute; left: 28px; top: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--brand); color: #fff; font-size: .7rem;
  display: grid; place-items: center;
}

.me {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 999px;
}
.me:hover { background: var(--bg-hover); }
.me-names { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-names strong, .me-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-names small { color: var(--muted); }
.auth-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.theme-toggle { align-self: flex-start; }

/* --- Botones -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 10px 20px; font-weight: 700; border: 1px solid transparent;
  transition: background .15s, opacity .15s; text-decoration: none !important; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { opacity: .85; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 16px; font-size: .9rem; }
.btn-block { width: 100%; padding: 13px; font-size: 1rem; }
.btn-compose { margin-top: 10px; padding: 14px; font-size: 1.05rem; width: 100%; }
.btn-compose svg { display: none; }
.btn-unfollow:hover { color: #f4212e; border-color: #f7b6bc; background: rgba(244, 33, 46, .08); }
.btn-unfollow:hover::after { content: attr(data-hover); }
.btn-unfollow:hover { font-size: 0; }
.btn-unfollow:hover::after { font-size: .9rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; border: 0; background: transparent; color: var(--text);
}
.icon-btn:hover { background: var(--bg-hover); }

/* --- Barra superior y pestañas ------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px;
  padding: 10px 16px 0;
  min-height: 53px;
}
.topbar h1 { font-size: 1.25rem; font-weight: 800; padding-bottom: 10px; }
.topbar > div > h1 { padding-bottom: 0; }
.topbar > div { padding-bottom: 8px; }
.topbar .icon-btn { margin-bottom: 8px; }
.topbar .tabs { width: 100%; margin: 0 -16px; width: calc(100% + 32px); }
.topbar .searchbox { flex: 1; margin-bottom: 10px; }
.tabs { display: flex; }
.tabs a {
  flex: 1; text-align: center; padding: 14px 8px; color: var(--muted); font-weight: 500; position: relative;
}
.tabs a:hover { background: var(--bg-hover); text-decoration: none; }
.tabs a.current { color: var(--text); font-weight: 700; }
.tabs a.current::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 2px; background: var(--brand);
}
.tabs-flat { border-bottom: 1px solid var(--line); }

/* --- Notificaciones flash ------------------------------------------------- */
.flashes { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.notification { padding: 10px 14px; border-radius: 12px; font-weight: 500; }
.notification.success, .notification.\ success { background: var(--ok-bg); color: var(--ok-text); }
.notification.error { background: var(--warn-bg); color: var(--warn-text); }

/* --- Avatares --------------------------------------------------------------- */
.avatar {
  --av: var(--brand);
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--av); color: #fff; font-weight: 700; font-size: 1rem;
  text-decoration: none !important; user-select: none;
}
.avatar.sm { width: 38px; height: 38px; font-size: .9rem; }
.avatar.xl { width: 128px; height: 128px; font-size: 2.6rem; border: 4px solid var(--bg); }

/* --- Caja de redacción -------------------------------------------------- */
.compose { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.compose-body { flex: 1; min-width: 0; }
.compose textarea {
  width: 100%; border: 0; resize: none; background: transparent; color: var(--text);
  font: inherit; font-size: 1.2rem; padding: 8px 0; outline: 0; min-height: 56px;
}
.compose-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.counter { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.counter.warn { color: #e6a100; }
.counter.over { color: #f4212e; font-weight: 700; }
.hint { padding: 14px 16px; }

/* --- Publicaciones ------------------------------------------------------- */
.post-card {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s;
}
.post-card:hover { background: var(--bg-hover); }
.post-card.detail { cursor: default; }
.post-card.detail:hover { background: transparent; }
.post-card.detail .post { font-size: 1.3rem; }
.post-card.thread { border-bottom: 0; position: relative; }
.post-card.thread::before {
  content: ''; position: absolute; left: 37px; top: 60px; bottom: -4px; width: 2px; background: var(--line);
}
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.post-name { color: var(--text); font-weight: 700; }
.post-head .muted { font-size: .95rem; }
.post { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; }
.post a.tag, .post a.mention { font-weight: 500; }
.reply-to { font-size: .9rem; }
.post-date { margin-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.post-actions { display: flex; gap: 32px; margin-top: 8px; margin-left: -8px; }
.act {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 999px;
  border: 0; background: transparent; color: var(--muted); font-size: .85rem; text-decoration: none !important;
}
.act svg { width: 18px; height: 18px; }
.act svg use { fill: none; }
.act-reply:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.act-like:hover, .act-like.on { color: var(--like); }
.act-like:hover { background: color-mix(in srgb, var(--like) 12%, transparent); }
.act-like.on svg { fill: var(--like); }
.act-like svg { fill: none; }
.act-like:disabled { cursor: default; opacity: .9; }
.act-like:disabled:hover { background: none; color: var(--muted); }
.act-share:hover { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.act-delete:hover { color: #f4212e; background: rgba(244, 33, 46, .1); }
.act.pop svg { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

.more { display: block; text-align: center; padding: 16px; border-bottom: 1px solid var(--line); }
.empty { padding: 48px 32px; text-align: center; color: var(--muted); }
.empty h3, .empty h2 { color: var(--text); font-size: 1.4rem; margin-bottom: 8px; }
.empty.slim { padding: 16px; border-bottom: 1px solid var(--line); }
.empty.big { padding: 80px 32px; }
.empty .btn { margin-top: 16px; }
.section-title { font-size: 1.2rem; font-weight: 800; padding: 14px 16px; border-bottom: 1px solid var(--line); }

/* --- Portada para visitantes ------------------------------------------- */
.hero {
  text-align: center; padding: 36px 24px; border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 14%, var(--bg)), var(--bg) 70%);
}
.hero h2 { font-size: 1.8rem; font-weight: 800; margin: 12px 0 8px; }
.hero p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }
.hero-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- Perfil ------------------------------------------------------------------ */
.profile { padding: 0 16px 12px; }
.cover {
  --av: var(--brand); height: 180px; margin: 0 -16px;
  background: linear-gradient(135deg, var(--av), color-mix(in srgb, var(--av) 45%, #005073));
}
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; margin-top: -64px; }
.profile-actions { padding-top: 76px; }
.profile-name { font-size: 1.35rem; font-weight: 800; margin-top: 10px; }
.pill { font-size: .7rem; vertical-align: middle; background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 999px; }
.bio { margin-top: 10px; white-space: pre-wrap; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 16px; height: 16px; }
.stats { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.stats a, .stats span { color: var(--muted); }
.stats strong { color: var(--text); }

/* --- Personas, búsqueda, tarjetas laterales --------------------------- */
.person { display: flex; align-items: center; gap: 10px; }
.person-names { display: flex; flex-direction: column; min-width: 0; flex: 1; color: var(--text); }
.person-names:hover { text-decoration: none; }
.person-names strong:hover { text-decoration: underline; }
.person-names small { color: var(--muted); }
.person-names strong, .person-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-bio { margin-top: 4px; font-size: .95rem; }
.row-item { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row-item:hover { background: var(--bg-hover); }

.searchbox { position: relative; display: block; }
.searchbox svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.searchbox input {
  width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none;
  border: 1px solid transparent; background: var(--bg-soft); color: var(--text);
  border-radius: 999px; padding: 12px 16px 12px 46px; font: inherit; outline: 0;
}
.searchbox input:focus { border-color: var(--brand); background: var(--bg); }
.sidebar-right .searchbox { position: sticky; top: 0; z-index: 2; padding: 2px 0 6px; background: var(--bg); }

.card { background: var(--bg-soft); border-radius: var(--radius); padding: 12px 0; }
.card h2 { font-size: 1.2rem; font-weight: 800; padding: 4px 16px 10px; }
.card .person { padding: 10px 16px; }
.card .person:hover, .trend:hover { background: var(--bg-hover); }
.trend { display: flex; flex-direction: column; padding: 10px 16px; color: var(--text); }
.trend:hover { text-decoration: none; }
.trend small { color: var(--muted); font-size: .8rem; }
.sidebar-right footer { color: var(--muted); font-size: .8rem; padding: 0 16px; }

/* --- Notificaciones ------------------------------------------------------- */
.notif { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif.unread { background: color-mix(in srgb, var(--brand) 6%, var(--bg)); }
.notif-icon { width: 32px; display: flex; justify-content: flex-end; }
.notif-icon svg { width: 28px; height: 28px; }
.notif-follow { color: var(--brand); }
.notif-like { color: var(--like); }
.notif-like svg { fill: var(--like); }
.notif-reply, .notif-mention { color: var(--ok); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.notif-post { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Formularios ---------------------------------------------------------- */
.auth { max-width: 420px; margin: 0 auto; padding: 36px 24px; text-align: center; }
.auth h2 { font-size: 1.7rem; font-weight: 800; margin: 14px 0 20px; }
.auth .form { text-align: left; padding: 0; }
.auth > p { margin-top: 18px; }
.form { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .form textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .form textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.field-error { color: #e0245e; font-size: .85rem; }
.settings .form { padding: 16px 16px 28px; border-bottom: 1px solid var(--line); }
.settings .btn { align-self: flex-start; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--av); cursor: pointer; border: 3px solid var(--bg); box-shadow: 0 0 0 2px transparent; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- Herramientas ------------------------------------------------------ */
.tool { padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.tool h2 { font-size: 1.2rem; font-weight: 800; margin-top: 10px; }
.tool-form { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-form input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.tool-output { font-size: 1.15rem; min-height: 1.6em; }
.color-pickers { display: flex; gap: 10px; }
.colorPicker { width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--line); }
.color-box { border: 2px solid var(--line); border-radius: 12px; padding: 16px; max-width: 400px; transition: background .2s, color .2s; }
.color-box p { margin: 4px 0; font-weight: 600; }

/* --- Navegación inferior (móvil) -------------------------------------- */
.bottomnav { display: none; }

/* --- Responsivo -------------------------------------------------------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 88px minmax(0, 600px) 320px; }
  .sidebar-left { align-items: center; padding: 12px 8px; }
  .brand span, .mainnav a span, .btn-compose span, .me-names, .me form, .auth-cta .btn-outline { display: none; }
  .mainnav a { padding: 12px; }
  .badge { left: 26px; }
  .btn-compose { width: 52px; height: 52px; padding: 0; }
  .btn-compose svg { display: block; width: 24px; height: 24px; }
  .auth-cta .btn-primary { padding: 10px; font-size: .75rem; white-space: normal; text-align: center; }
  .theme-toggle { align-self: center; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: 88px minmax(0, 600px); }
  .sidebar-right { display: none; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar-left { display: none; }
  .main { border: 0; }
  .topbar { padding: 8px 16px 0; }
  .post-actions { gap: 18px; }
  .avatar.xl { width: 88px; height: 88px; font-size: 1.8rem; }
  .profile-head { margin-top: -44px; }
  .profile-actions { padding-top: 52px; }
  .cover { height: 130px; }
  .bottomnav {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; height: 56px;
    background: var(--bg); border-top: 1px solid var(--line);
  }
  .bottomnav a { position: relative; padding: 10px 16px; color: var(--text); }
  .bottomnav svg { width: 24px; height: 24px; }
  .bottomnav .fab {
    position: fixed; right: 16px; bottom: 72px; width: 56px; height: 56px; border-radius: 50%;
    background: var(--brand); color: #fff; display: grid; place-items: center; padding: 0; box-shadow: var(--shadow);
  }
  .bottomnav .dot { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
}
