/* TVBOX BOL Admin — Custom CSS (complementa Tailwind) */

/* ── Variables / Design Tokens ── */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --darkbg: #0f172a;
  --darkcard: #1e293b;
  --border: rgba(255, 255, 255, 0.08);
}

/* ── Fuentes ── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--darkbg);
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
}

/* ── Glass Panel ── */
.glass-panel {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}

/* ── Nav Links ── */
.nav-link {
  color: #94a3b8;
  transition: all 0.15s ease-in-out;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}
.nav-link.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border-right: 2px solid var(--primary);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn-primary:hover { background-color: #34d399; box-shadow: 0 0 20px rgba(16,185,129,0.3); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: rgba(51,65,85,0.8);
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid rgba(100,116,139,0.5);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-secondary:hover { background-color: rgba(71,85,105,0.9); color: white; border-color: rgba(148,163,184,0.5); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-ghost:hover { background-color: rgba(255,255,255,0.05); color: white; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: rgba(239,68,68,0.15);
  color: #f87171;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid rgba(239,68,68,0.3);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background-color: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.5); }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Action Buttons (iconos en tabla) ── */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
}
.action-btn-success { color: #6ee7b7; }
.action-btn-success:hover { background: rgba(16,185,129,0.15); color: #34d399; }
.action-btn-warning { color: #fbbf24; }
.action-btn-warning:hover { background: rgba(245,158,11,0.15); color: #f59e0b; }
.action-btn-danger { color: #fca5a5; }
.action-btn-danger:hover { background: rgba(239,68,68,0.15); color: #f87171; }
.action-btn-ghost { color: #94a3b8; }
.action-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }

/* ── Form Inputs ── */
.form-input {
  background-color: rgba(15,23,42,0.8);
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: white;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.form-input::placeholder { color: #475569; }

.form-select {
  background-color: rgba(15,23,42,0.8);
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: white;
  font-size: 0.875rem;
  transition: border-color 0.15s;
  outline: none;
  cursor: pointer;
}
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.form-select option { background-color: #1e293b; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(100,116,139,0.5);
  background-color: rgba(15,23,42,0.8);
  cursor: pointer;
  accent-color: var(--primary);
}

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-pending {
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.25);
}
.status-approved {
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.25);
}
.status-suspended {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}

/* ── Modals ── */
.modal-dialog {
  background: transparent;
  padding: 0;
  border: none;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 50;
}
/* Solo aplicar flex cuando el dialog está abierto nativamente */
.modal-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-dialog::backdrop {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-content {
  background: #1e293b;
  border: 1px solid rgba(100,116,139,0.3);
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  margin: 1rem;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(100,116,139,0.2);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(100,116,139,0.2);
}
.modal-close-btn {
  padding: 0.375rem;
  color: #94a3b8;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close-btn:hover { color: white; background: rgba(255,255,255,0.08); }

/* ── HTMX Indicator ── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; }
.htmx-request.htmx-indicator { display: inline-flex; }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.7); }

/* ── Animaciones ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.2s ease-out; }

/* ── Transición de fila eliminada (HTMX delete swap) ── */
.htmx-swapping { opacity: 0; transition: opacity 0.3s ease-out; }
