/* =====================================================
   Turno507 - Estilos Principales
   Tema: Turno507 Blue
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg-primary:    #060b14;
  --bg-secondary:  #0c1626;
  --bg-card:       #111d30;
  --bg-card-hover: #162440;
  --accent:        #2563eb;
  --accent-dark:   #1d4ed8;
  --accent-glow:   rgba(37, 99, 235, 0.15);
  --success:       #10b981;
  --success-bg:    rgba(16, 185, 129, 0.12);
  --danger:        #ef4444;
  --danger-bg:     rgba(239, 68, 68, 0.12);
  --info:          #60a5fa;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(37, 99, 235, 0.35);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.5);
  --font-display:  'Bebas Neue', sans-serif;
  --font-body:     'Nunito', sans-serif;
  --font-mono:     'DM Mono', monospace;
  --radius:        12px;
  --radius-lg:     20px;
  --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Typography ───────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 1px; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

/* ── Layout ───────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Navbar ───────────────────────────────────────── */
.navbar {
  background: rgba(6, 11, 20, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-accent);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.nav-subtitle {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.1); }

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

.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover { border-color: var(--border-accent); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
  letter-spacing: 1px;
}

/* ── Stat Cards ───────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}

.stat-card.success::before { background: var(--success); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.info::before    { background: var(--info); }

.stat-value {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.5rem;
  font-weight: 600;
}

.stat-icon {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 3rem;
  opacity: 0.08;
}

/* ── Form Elements ────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

/* ── Badge / Chips ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-accent  { background: var(--accent-glow); color: var(--accent); }
.badge-muted   { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Alert ────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease;
}

.alert-success { background: var(--success-bg); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-danger  { background: var(--danger-bg);  border: 1px solid rgba(239,68,68,0.3);  color: var(--danger); }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: var(--info); }

/* ── Table ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; }

th {
  background: rgba(245, 158, 11, 0.06);
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-accent);
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Camera / Video ───────────────────────────────── */
.camera-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1); /* Mirror effect */
}

.camera-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: rgba(8,12,22,0.8);
  backdrop-filter: blur(4px);
}

.camera-corner {
  position: absolute;
  width: 60px; height: 60px;
}
.camera-corner::before, .camera-corner::after {
  content: '';
  position: absolute;
  background: var(--accent);
}
.camera-corner::before { width: 3px; height: 100%; }
.camera-corner::after  { width: 100%; height: 3px; }

.cc-tl { top: 20px; left: 20px; }
.cc-tl::before { top: 0; left: 0; }
.cc-tl::after  { top: 0; left: 0; }

.cc-tr { top: 20px; right: 20px; }
.cc-tr::before { top: 0; right: 0; }
.cc-tr::after  { top: 0; right: 0; }

.cc-bl { bottom: 20px; left: 20px; }
.cc-bl::before { bottom: 0; left: 0; }
.cc-bl::after  { bottom: 0; left: 0; }

.cc-br { bottom: 20px; right: 20px; }
.cc-br::before { bottom: 0; right: 0; }
.cc-br::after  { bottom: 0; right: 0; }

/* ── Employee Avatar ──────────────────────────────── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 2px solid var(--accent);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Animations ───────────────────────────────────── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes scanLine {
  0%   { top: 0; opacity: 1; }
  50%  { opacity: 0.6; }
  100% { top: 100%; opacity: 1; }
}

.animate-fade { animation: fadeIn 0.4s ease; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse-ring { animation: pulse-ring 2s infinite; }

/* ── Scan animation on camera ─────────────────────── */
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanLine 3s ease-in-out infinite;
  z-index: 5;
}

/* ── Loading Spinner ──────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Grid helpers ─────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .card { padding: 1rem; }
}

/* ── Utility ──────────────────────────────────────── */
.text-accent   { color: var(--accent); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.text-mono     { font-family: var(--font-mono); }
.fw-bold       { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }

/* ── Footer firma ─────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: .55rem 1rem;
  font-size: .68rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  letter-spacing: .4px;
  flex-shrink: 0;
  background: var(--bg-primary);
}
.app-footer strong { color: var(--accent); font-weight: 700; }

/* ── Nav logo image ───────────────────────────────── */
.nav-logo-img {
  height: 34px;
  width: auto;
  display: block;
  mix-blend-mode: lighten; /* fondo negro desaparece en el nav oscuro */
}

/* ── Page header ──────────────────────────────────── */
.page-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-header .overline {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* ── Recognition result overlay ──────────────────── */
.recognition-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  animation: fadeIn 0.35s ease;
  position: relative;
  overflow: hidden;
}

.recognition-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}

.recognition-card.success-state::before { background: var(--success); }
.recognition-card.danger-state::before  { background: var(--danger); }

.emp-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto 1rem;
  object-fit: cover;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── Recent records list ──────────────────────────── */
.record-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  transition: var(--transition);
  animation: slideDown 0.3s ease;
}

.record-item:hover { border-color: var(--border-accent); }

.record-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 60px;
}

/* ── Clock display ────────────────────────────────── */
.clock-display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: var(--text-primary);
  letter-spacing: 4px;
  text-align: center;
  text-shadow: 0 0 40px rgba(245,158,11,0.3);
}

.date-display {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: -0.5rem;
}

/* ── Progress bar ─────────────────────────────────── */
.progress {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.5s ease;
}
