/* ═══════════════════════════════════════════════
   AttendEye — Clean SaaS Light Theme
   (Modern Typography System with Local Inter via npm)
   ═══════════════════════════════════════════════ */

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.55;

  --bs-body-bg: #f8fafc;
  --bs-body-color: #1e293b;
  --bs-emphasis-color: #0f172a;
  --bs-secondary-bg: #ffffff;
  --bs-tertiary-bg: #f1f5f9;
  --bs-border-color: #eaeaea;
  --bs-card-bg: #ffffff;
  --bs-card-border-color: #eaeaea;

  --ae-accent: #4f68d6;
  --ae-accent-rgb: 79, 104, 214;
  --ae-accent-dim: rgba(79, 104, 214, 0.08);
  --ae-success: #10b981;
  --ae-success-dim: rgba(16, 185, 129, 0.1);
  --ae-warning: #f59e0b;
  --ae-danger: #f43f5e;
  --ae-muted: #64748b;
  --ae-glass: rgba(0, 0, 0, 0.02);
  --ae-card-shadow: none;
}

/* ═══════════════════════════════════════════════
   Strict Zero-Shadow Rule (User Preference)
   ═══════════════════════════════════════════════ */
*, *::before, *::after,
.card, .btn, .shadow, .shadow-sm, .shadow-lg,
.modal-content, .dropdown-menu, .alert, .badge, .form-control, .form-select,
.ae-stat-tile, .ae-record-card, .ae-record-row, .ae-floating-controls, .ae-hud-stats {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}

:root {

  --ae-pastel-primary-bg: #eef2ff;
  --ae-pastel-primary-text: #4338ca;
  --ae-pastel-primary-border: #c7d2fe;

  --ae-pastel-success-bg: #ecfdf5;
  --ae-pastel-success-text: #065f46;
  --ae-pastel-success-border: #a7f3d0;

  --ae-pastel-danger-bg: #fff1f2;
  --ae-pastel-danger-text: #9f1239;
  --ae-pastel-danger-border: #fecdd3;

  --ae-pastel-warning-bg: #fffbeb;
  --ae-pastel-warning-text: #92400e;
  --ae-pastel-warning-border: #fde68a;

  --ae-pastel-info-bg: #f0f7ff;
  --ae-pastel-info-text: #0369a1;
  --ae-pastel-info-border: #bae6fd;

  --ae-pastel-purple-bg: #f5f3ff;
  --ae-pastel-purple-text: #5b21b6;
  --ae-pastel-purple-border: #ddd6fe;

  --ae-pastel-slate-bg: #f8fafc;
  --ae-pastel-slate-text: #475569;
  --ae-pastel-slate-border: #e2e8f0;

  --ae-table-th-bg: #f1f5f9;
  --ae-table-th-border: #cbd5e1;

  --ae-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base Reset & Typography Scale (Slightly Larger & Modern) ─── */
html {
  font-size: 16.5px;
  -webkit-text-size-adjust: 100%;
}

body, #app {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.025rem;
  line-height: 1.58;
  letter-spacing: -0.012em;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Inherit modern Inter font across all elements with proper scale */
body, button, input, select, textarea, optgroup, table, .btn, .form-control, .form-select, .badge {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: inherit;
}

/* Modern Proper Bold Icons Definition */
svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Give SVGs with stroke a solid, crisp, modern bold weight */
svg[stroke="currentColor"] {
  stroke-width: 2.25px;
}

.icon-bold {
  stroke-width: 2.5px !important;
}

.ae-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Card & Card Header Standardization ─── */
.card {
  border-color: #eaeaea !important;
  background-color: #ffffff;
}

.card-header,
.ae-card-header {
  background-color: #ffffff !important;
  border-bottom: 1px solid #eaeaea !important;
  min-height: 56px;
  padding: 0.75rem 1.15rem !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.card-header h6,
.ae-card-header h6,
.card-header .card-title {
  margin: 0;
  font-size: 1.025rem;
  font-weight: 650;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ─── Fractional Spacing Fallbacks (Fixes Bootstrap 5 missing .5 classes) ─── */
.p-1\.5   { padding: 0.375rem !important; }
.p-2\.5   { padding: 0.625rem !important; }
.p-3\.5   { padding: 0.875rem !important; }
.py-1\.5  { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2\.5  { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.px-1\.5  { padding-left: 0.375rem !important; padding-right: 0.375rem !important; }
.px-2\.5  { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.px-3\.5  { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
.mb-1\.5  { margin-bottom: 0.375rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }

/* ─── Global Shadow Removal & Crisp Flat Styling ─── */
*,
.card,
.card-header,
.shadow,
.shadow-sm,
.shadow-lg,
.modal-content,
.btn,
.badge,
.ae-card,
.dropdown-menu {
  box-shadow: none !important;
}

/* ─── Form Controls: Crisp White Background & Clean Subtle Border ─── */
.form-control,
.form-select {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  background-color: #ffffff !important;
  border-color: #a5b4fc !important;
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.25) !important;
  outline: none;
}

/* ─── Centered Icon Alignment in Buttons & Badges ─── */
.btn-icon-center,
.btn-pastel {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  transition: all 0.15s ease-in-out !important;
}

.btn-icon-center svg,
.btn-icon-center i,
.btn-pastel svg,
.btn-pastel i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  margin: 0 !important;
}

/* ─── Pastel Action Buttons ─── */
.btn-pastel-primary {
  background-color: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
  border-radius: 8px;
  font-weight: 550 !important;
}
.btn-pastel-primary:hover, .btn-pastel-primary:focus {
  background-color: #e0e7ff !important;
  color: #3730a3 !important;
  border-color: #a5b4fc !important;
}

.btn-pastel-success {
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
  border-radius: 8px;
  font-weight: 550 !important;
}
.btn-pastel-success:hover, .btn-pastel-success:focus {
  background-color: #d1fae5 !important;
  color: #047857 !important;
  border-color: #6ee7b7 !important;
}

.btn-pastel-danger {
  background-color: #fff1f2 !important;
  color: #9f1239 !important;
  border: 1px solid #fecdd3 !important;
  border-radius: 8px;
  font-weight: 550 !important;
}
.btn-pastel-danger:hover, .btn-pastel-danger:focus {
  background-color: #ffe4e6 !important;
  color: #881337 !important;
  border-color: #fda4af !important;
}

.btn-pastel-secondary {
  background-color: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px;
  font-weight: 550 !important;
}
.btn-pastel-secondary:hover, .btn-pastel-secondary:focus {
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #94a3b8 !important;
}

/* ─── Bootstrap .input-group and .btn-group Proper Corner Management ─── */
.input-group,
.btn-group {
  border-radius: 8px;
}

/* Reset all inner items to 0 radius */
.input-group > .btn,
.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.btn-group > .btn {
  border-radius: 0 !important;
}

/* First item gets rounded left corners */
.input-group > :first-child,
.btn-group > :first-child {
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Last item gets rounded right corners */
.input-group > :last-child,
.btn-group > :last-child {
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Only child gets full 8px radius */
.input-group > :only-child,
.btn-group > :only-child {
  border-radius: 8px !important;
}

/* Input group text styling */
.input-group-text {
  border-color: #e2e8f0 !important;
  color: #64748b;
  font-size: 0.85rem;
}

/* ─── Seamless Symmetrical Search Box ─── */
.ae-search-group {
  border-radius: 8px !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  transition: all 0.15s ease-in-out !important;
}

.ae-search-group:focus-within {
  border-color: #a5b4fc !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15) !important;
}

.ae-search-group .input-group-text {
  background-color: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  padding-left: 0.85rem !important;
  padding-right: 0.35rem !important;
  height: 100% !important;
}

.ae-search-group .form-control {
  border: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding-left: 0.35rem !important;
  padding-right: 0.85rem !important;
  height: 100% !important;
  font-size: 0.84rem !important;
}

.ae-search-group .form-control:focus,
.ae-search-group .form-control:focus-visible {
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  border-color: transparent !important;
  background-color: transparent !important;
}

.ae-search-group .btn-clear {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  color: #94a3b8 !important;
  padding-left: 0.35rem !important;
  padding-right: 0.85rem !important;
  height: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.15s ease !important;
}

.ae-search-group .btn-clear:hover {
  color: #ef4444 !important;
}

/* ─── Pastel Badges ─── */
.badge-pastel-primary {
  background-color: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

.badge-pastel-success {
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1px solid #a7f3d0 !important;
}

.badge-pastel-danger {
  background-color: #fff1f2 !important;
  color: #9f1239 !important;
  border: 1px solid #fecdd3 !important;
}

.badge-pastel-warning {
  background-color: #fffbeb !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

.badge-pastel-info {
  background-color: #f0f7ff !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

.badge-pastel-purple {
  background-color: #f5f3ff !important;
  color: #5b21b6 !important;
  border: 1px solid #ddd6fe !important;
}

.badge-pastel-slate {
  background-color: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

/* ─── Standard Table Header (Soft Tint & Distinct Bottom Border) ─── */
.table thead th,
.table-header-pastel th,
.ae-recap-table thead th {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 650 !important;
  font-size: 0.77rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  border-top: none !important;
  border-bottom: 2px solid #cbd5e1 !important;
  padding: 0.75rem 0.85rem !important;
  vertical-align: middle !important;
}

.table thead th.cursor-pointer:hover,
.ae-recap-table thead th.cursor-pointer:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.ae-recap-table tbody tr {
  transition: background-color 0.15s ease;
}

.ae-recap-table tbody tr:hover td {
  background-color: #f8fafc !important;
}

.ae-recap-table tbody td {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 0.7rem 0.85rem !important;
  vertical-align: middle !important;
}

/* ─── Navigation Link (Modern Bold & Slightly Larger) ─── */
.cf-nav-link {
  border-radius: 9px;
  transition: all 0.15s ease-in-out;
  color: #475569 !important;
  font-weight: 550;
  font-size: 0.985rem;
  padding: 0.6rem 0.85rem !important;
}
.cf-nav-link:not(.active):hover {
  background-color: rgba(15, 23, 42, 0.05);
  color: #0f172a !important;
}
.cf-nav-link:not(.active):hover svg {
  color: #0f172a !important;
}
.cf-nav-link.active {
  background-color: rgba(13, 110, 253, 0.1) !important;
  color: #0d6efd !important;
  font-weight: 650;
}
.cf-nav-link.active .icon-active {
  color: #0d6efd !important;
}

/* ─── Custom Scrollbar (Voucher Style) ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ═══ Loading Overlay ═══ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.3s ease;
}

.loading-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 3px;
  color: var(--ae-accent);
}

.loading-overlay h4 {
  background: linear-gradient(135deg, #0d6efd, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══ Camera Container ═══ */
.ae-camera-wrap {
  position: relative;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 16/10;
}

.ae-camera-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ae-camera-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ae-camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  z-index: 2;
  color: var(--bs-body-color);
}

.ae-camera-placeholder .bi {
  font-size: 3rem;
  opacity: 0.3;
}

.ae-camera-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 5;
}

/* ═══ Camera HUD Badges ═══ */
.ae-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ═══ Face Card List Items ═══ */
.ae-face-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: #ffffff;
  border: 1px solid #eaeaea;
  transition: all 0.2s var(--ae-ease);
}

.ae-face-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ae-face-item.recognized {
  border-color: var(--ae-success);
  background: rgba(16, 185, 129, 0.08);
  animation: recognized-pulse 1.2s ease-out;
}

.ae-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ae-glass);
  border: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--ae-accent);
  flex-shrink: 0;
}

/* ═══ Activity Log Items ═══ */
.ae-log-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  animation: slide-in 0.2s var(--ae-ease);
}

.ae-log-time {
  font-size: 0.775rem;
  color: var(--ae-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ae-log-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ae-log-item.spoken {
  border-left: 3px solid var(--ae-accent);
  background: rgba(13, 110, 253, 0.03);
}

.ae-log-item.register {
  border-left: 3px solid var(--ae-success);
}

.ae-log-item.system {
  border-left: 3px solid var(--ae-warning);
}

/* ═══ Toast ═══ */
.ae-toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1090;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

.ae-toast {
  padding: 0.8rem 1.35rem;
  border-radius: 0.5rem;
  font-size: 0.925rem;
  font-weight: 500;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slide-in-right 0.3s var(--ae-ease);
  max-width: 360px;
}

.ae-toast.success { border-left: 4px solid #10b981; }
.ae-toast.error   { border-left: 4px solid #ef4444; }
.ae-toast.info    { border-left: 4px solid #0d6efd; }
.ae-toast.exiting { animation: slide-out-right 0.3s var(--ae-ease) forwards; }

/* ═══ Animations ═══ */
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(25px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-out-right {
  to { opacity: 0; transform: translateX(25px); }
}

@keyframes recognized-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
