/* ============================================================
   Tío Streaming — Global Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg:      #070711;
  --bg2:     #0f0f1e;
  --card:    #13132a;
  --card2:   #1a1a35;
  --accent:  #6c3fef;
  --accent2: #3f8fef;
  --text:    #e8e8f0;
  --text2:   #9898b8;
  --green:   #22c55e;
  --red:     #ef4444;
  --yellow:  #f59e0b;
  --border:  rgba(108, 63, 239, 0.18);
  --shadow:  0 4px 24px rgba(0,0,0,0.45);
  --radius:  12px;
  --grad:    linear-gradient(135deg, var(--accent), var(--accent2));
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, button, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { color: var(--text2); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 2px 16px rgba(108, 63, 239, 0.35);
}
.btn-primary:hover { box-shadow: 0 4px 24px rgba(108, 63, 239, 0.55); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-green { background: var(--green); color: #fff; }
.btn-red   { background: var(--red); color: #fff; }
.btn-outline-accent {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent2);
}
.btn-outline-accent:hover { background: rgba(108, 63, 239, 0.12); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.55); border-color: rgba(108,63,239,0.35); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-green   { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge-red     { background: rgba(239,68,68,0.15);  color: var(--red); }
.badge-yellow  { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-purple  { background: rgba(108,63,239,0.15); color: #a78bfa; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.88rem; font-weight: 500; color: var(--text2); }
.form-input {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.72rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,63,239,0.15);
}
.form-input::placeholder { color: var(--text2); opacity: 0.6; }
.form-input.error { border-color: var(--red); }

.error-msg {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 500;
  display: none;
}
.error-msg.visible { display: block; }

.success-msg {
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 500;
  display: none;
}
.success-msg.visible { display: block; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  background: var(--card2);
  color: var(--text2);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody td { padding: 0.75rem 1rem; color: var(--text); }
tbody tr:last-child { border-bottom: none; }

/* ── Loader ─────────────────────────────────────────────────── */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal h3 { margin-bottom: 0.75rem; }
.modal p  { margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--green); color: var(--green); }
.toast.error   { border-left: 3px solid var(--red);   color: var(--red); }
.toast.info    { border-left: 3px solid var(--accent2); color: var(--accent2); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── Utility ────────────────────────────────────────────────── */
.flex        { display: flex; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1       { gap: 0.5rem; }
.gap-2       { gap: 1rem; }
.gap-3       { gap: 1.5rem; }
.mt-1        { margin-top: 0.5rem; }
.mt-2        { margin-top: 1rem; }
.mt-3        { margin-top: 1.5rem; }
.mb-2        { margin-bottom: 1rem; }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-muted  { color: var(--text2); }
.text-sm     { font-size: 0.875rem; }
.text-center { text-align: center; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }

/* ── Gradients text ─────────────────────────────────────────── */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text2);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  .btn { padding: 0.6rem 1rem; font-size: 0.88rem; }
  /* auth boxes: más padding lateral */
  .auth-box { padding: 2rem 1.25rem; }
  /* inputs más grandes para touch */
  .form-input { padding: 0.75rem 0.9rem; font-size: 1rem; }
  /* botones con mínimo 44px de alto para touch targets */
  .btn { min-height: 44px; }
}
@media (max-width: 380px) {
  /* pantallas muy pequeñas: reducir nav padding */
  .nav { padding: 0.85rem 1rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { text-align: center; justify-content: center; }
}
