/* ===========================================================
   Global Petroquimica · Generador de Publicaciones
   Identidad: navy corporativo + rojo de marca (#DC1414)
   =========================================================== */

:root {
  --navy: #0a1f3c;
  --navy-700: #122a4d;
  --navy-600: #1c3a63;
  --red: #d6131b;
  --red-700: #b00f16;
  --blue: #1746a2;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #1a2433;
  --muted: #5b6b82;
  --border: #e1e7f0;
  --shadow: 0 8px 30px rgba(10, 31, 60, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Navbar ---------- */
.navbar {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-600) 100%);
  color: #fff;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar .brand { display: flex; align-items: center; gap: 0.7rem; }
.navbar .brand img { height: 38px; background: #fff; padding: 4px 8px; border-radius: 8px; }
.navbar .brand span { font-weight: 700; letter-spacing: 0.3px; }
.navbar .brand small { display: block; font-weight: 400; opacity: 0.7; font-size: 0.72rem; }
.navbar nav { display: flex; align-items: center; gap: 1.2rem; }
.navbar nav a { color: #fff; opacity: 0.9; font-weight: 500; font-size: 0.95rem; }
.navbar nav a:hover { opacity: 1; text-decoration: none; }
.navbar .user-pill {
  background: rgba(255,255,255,0.12);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem; flex: 1; }
.container-narrow { max-width: 460px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.card + .card { margin-top: 1.4rem; }

/* ---------- Hero / generar ---------- */
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-600) 60%, var(--blue) 130%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(214,19,27,0.35), transparent 70%);
}
.hero h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.hero p { opacity: 0.88; max-width: 640px; }
.hero .accent { color: #ff6b6b; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(214,19,27,0.35); }
.btn-primary:hover { background: var(--red-700); color: #fff; }
.btn-light { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-light:hover { background: #f0f3f8; color: var(--navy); }
.btn-ghost { background: rgba(255,255,255,0.14); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.24); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.1rem; }
.btn-danger-ghost { background: transparent; color: var(--red); border: 1px solid var(--border); padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.btn-danger-ghost:hover { background: #fff0f0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; color: var(--navy); }
.field input, .field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: #fbfcfe;
}
.field input:focus, .field select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }

.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { height: 60px; }
.auth-title { text-align: center; color: var(--navy); margin-bottom: 1.4rem; }

/* ---------- Flash ---------- */
.flash { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.92rem; }
.flash.error { background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
.flash.success { background: #e7f6ec; color: #166534; border: 1px solid #bbe6c8; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  padding: 1rem 1.2rem;
}
.stat .num { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.stat .lbl { font-size: 0.82rem; color: var(--muted); }

/* ---------- Tech chips ---------- */
.section-title { color: var(--navy); font-size: 1.15rem; margin: 1.8rem 0 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.section-title::before { content: ""; width: 6px; height: 20px; background: var(--red); border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { background: #eef2f9; color: var(--navy-600); border: 1px solid var(--border); padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }

/* ---------- Publicacion (preview tipo LinkedIn) ---------- */
.post-card { max-width: 600px; margin: 0 auto; }
.post-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; }
.post-head .avatar { width: 48px; height: 48px; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.post-head .avatar img { width: 40px; }
.post-head .meta strong { color: var(--navy); display: block; line-height: 1.2; }
.post-head .meta small { color: var(--muted); }
.post-body { white-space: pre-wrap; font-size: 1rem; color: var(--text); }
.post-hashtags { color: var(--blue); font-weight: 600; margin-top: 0.6rem; white-space: pre-wrap; }
.post-image { width: 100%; border-radius: 12px; margin: 1rem 0; border: 1px solid var(--border); }
.post-meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.tag { font-size: 0.74rem; background: #eef2f9; color: var(--muted); padding: 0.2rem 0.6rem; border-radius: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

/* ---------- Historial ---------- */
.hist-item { display: flex; gap: 1rem; align-items: flex-start; }
.hist-item .thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: #eef2f9; }
.hist-item .thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.6rem; }
.hist-body { flex: 1; min-width: 0; }
.hist-body h3 { color: var(--navy); font-size: 1.02rem; margin-bottom: 0.2rem; }
.hist-body p { color: var(--muted); font-size: 0.9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hist-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty .big { font-size: 2.5rem; }

/* ---------- Spinner overlay ---------- */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,31,60,0.7);
  z-index: 100;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 1.2rem;
}
.overlay.show { display: flex; }
.overlay .spinner { width: 56px; height: 56px; border: 5px solid rgba(255,255,255,0.25); border-top-color: var(--red); border-radius: 50%; animation: spin 0.9s linear infinite; }
.overlay p { color: #fff; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 1.1rem;
  font-size: 0.85rem;
}
.footer a { color: #fff; font-weight: 600; }

@media (max-width: 640px) {
  .navbar { flex-direction: column; gap: 0.6rem; }
  .navbar .brand small { display: none; }
}
