/* Modern Sleek UI for Teacher Face Attendance System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark-bg: #0f172a;
  --dark-card: #1e293b;
  --dark-border: #334155;
  --light-bg: #f8fafc;
  --light-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-main);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-text {
  font-family: 'Outfit', sans-serif;
}

/* Glassmorphism utility */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.glass-dark-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.6);
  color: #f8fafc;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Admin Sidebar Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

.sidebar {
  width: 270px;
  background: #0f172a;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  list-style: none;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.sidebar-menu::-webkit-scrollbar {
  width: 5px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.sidebar-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.85rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-item {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.95rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  transition: transform 0.2s ease;
}

.sidebar-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.sidebar-link.active {
  color: white;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  font-weight: 600;
}

.sidebar-link.active i {
  transform: scale(1.15);
}

.sidebar-user-footer {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #f1f5f9;
}

.top-navbar {
  background: white;
  height: 70px;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 999;
}

.content-body {
  padding: 1.75rem;
  flex: 1;
}

/* Responsive Sidebar Mobile Drawer */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -285px;
    bottom: 0;
    width: 270px;
    z-index: 1050;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
  }

  .sidebar.show {
    left: 0;
  }

  .top-navbar {
    padding: 0 1rem;
  }

  .content-body {
    padding: 1.25rem 1rem;
  }
}

/* Custom Settings Tab Pills Styling */
.nav-pills-custom .nav-link {
  color: #64748b;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all 0.25 ease;
  border: 1px solid transparent;
}

.nav-pills-custom .nav-link:hover {
  color: var(--primary);
  background: #eef2ff;
}

.nav-pills-custom .nav-link.active {
  color: white;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary { background: #eef2ff; color: #4f46e5; }
.stat-icon.success { background: #ecfdf5; color: #10b981; }
.stat-icon.warning { background: #fffbeb; color: #f59e0b; }
.stat-icon.danger  { background: #fef2f2; color: #ef4444; }

/* Camera Kiosk Container */
.kiosk-container {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
  color: white;
  padding: 1.5rem;
}

.webcam-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 70, 229, 0.3);
  border: 2px solid rgba(99, 102, 241, 0.4);
  background: #000;
}

.webcam-video {
  width: 100%;
  height: 480px;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view for natural interaction */
}

.webcam-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
}

/* Face Target HUD Overlay */
.hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
}

.hud-face-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 260px;
  height: 310px;
  border: 3px dashed rgba(99, 102, 241, 0.8);
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.4);
  transition: all 0.3s ease;
}

.hud-face-frame.detected {
  border-color: #10b981;
  border-style: solid;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.2), 0 0 25px rgba(16, 185, 129, 0.6);
}

.hud-status-badge {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  padding: 0.6rem 1.25rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Custom Table Styles */
.custom-table-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.925rem;
}

.table tr:last-child td {
  border-bottom: none;
}

/* Pulsing status dot */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-dot.green {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}

.pulse-dot.amber {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse-amber 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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