/* style.css — Hikvision Attendance Demo */

:root {
  --bs-body-bg: #f4f6f9;
}

body {
  background-color: var(--bs-body-bg);
  font-family: 'Segoe UI', 'Sarabun', sans-serif;
}

/* ─── Navbar ─── */
.navbar-brand { letter-spacing: .5px; }

/* ─── Stat Cards ─── */
.stat-card { border-radius: 12px !important; }
.stat-card .card-body { padding: 1.25rem; }
.stat-blue  { border-left: 4px solid #0d6efd !important; }
.stat-green { border-left: 4px solid #198754 !important; }
.stat-red   { border-left: 4px solid #dc3545 !important; }
.stat-orange{ border-left: 4px solid #fd7e14 !important; }

/* ─── Live Badge ─── */
.live-badge {
  animation: pulse-red 1.4s ease-in-out infinite;
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* ─── Event Feed ─── */
.event-item {
  transition: background .15s;
}
.event-item:hover { background: #f8f9fa; }
.event-item.new-event {
  animation: slide-in .3s ease-out;
  background: #e8f4fd;
}
@keyframes slide-in {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Face Thumbnails ─── */
.face-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 65px;
  overflow: hidden;
  border-radius: 6px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
}
.face-thumb img { width: 100%; height: 100%; object-fit: cover; }
.face-placeholder { width: 52px; height: 65px; display: flex; align-items: center; justify-content: center; color: #adb5bd; font-size: 1.5rem; }

.face-thumb-sm {
  width: 44px;
  height: 55px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.face-thumb-sm:hover { transform: scale(1.08); }

/* ─── SSE Status Badge ─── */
#sse-status.online  { background-color: #198754 !important; }
#sse-status.offline { background-color: #6c757d !important; }

/* ─── Table ─── */
.table th { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }

/* ─── Cards ─── */
.card { border-radius: 12px !important; }
.card-header { border-radius: 12px 12px 0 0 !important; }

/* ─── Code ─── */
code { background: #f0f0f0; padding: 1px 6px; border-radius: 4px; font-size: .85em; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ─── Label Badges ─── */
.badge-first-in { background:#d1fae5; color:#065f46; }
.badge-last-out { background:#fee2e2; color:#991b1b; }
.badge-check    { background:#dbeafe; color:#1e40af; }
.badge-stranger { background:#fef3c7; color:#92400e; }

/* ─── Demo Panel XML block ─── */
.xml-block {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  line-height: 1.5;
  border: none !important;
  overflow-x: auto;
}

/* ─── Nav tabs small ─── */
.nav-tabs-sm .nav-link {
  font-size: .78rem;
  border-radius: 6px 6px 0 0;
}
.nav-tabs-sm .nav-link:not(.active) { color: #6c757d; }

/* ─── Demo Panel header ─── */
#demo-panel .card-header {
  border-radius: 12px 12px 0 0 !important;
}

/* ─── ไอคอนหมุน (ใช้ได้ทุกหน้า เช่น <i class="bi bi-arrow-repeat spin">) ─── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

