/* SSMB Balsabha Attendance — Custom CSS */

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ── Custom checkbox ────────────────────────────────────────────────────────── */
.checkbox-btn {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid #475569;
  background: #1e293b;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, transform 100ms;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.checkbox-btn[aria-checked="true"] {
  border-color: #22c55e;
  background: #22c55e;
}
.checkbox-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  .checkbox-btn[aria-checked="true"] {
    animation: check-pop 150ms ease-out;
  }
}
@keyframes check-pop {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Checkmark SVG */
.checkbox-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 150ms ease-out;
}
.checkbox-btn[aria-checked="true"] svg {
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: reduce) {
  .checkbox-btn svg { transition: none; }
  .checkbox-btn { transition: none; }
}

/* ── Student rows ───────────────────────────────────────────────────────────── */
.student-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 100ms;
  border-radius: 0.75rem;
  margin-bottom: 4px;
}
.student-row:hover { background: rgba(99, 102, 241, 0.08); }
.student-row:active { background: rgba(99, 102, 241, 0.15); }
.student-row.checked { background: rgba(34, 197, 94, 0.06); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: auto;
  max-width: 320px;
  text-align: center;
  animation: toast-in 200ms ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast-success { background: #166534; color: #bbf7d0; border: 1px solid #22c55e; }
.toast-error   { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }
.toast-info    { background: #1e3a5f; color: #bfdbfe; border: 1px solid #3b82f6; }

/* ── Page fade-in ───────────────────────────────────────────────────────────── */
.page-content { animation: fade-in 120ms ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page-content { animation: none; }
}

/* ── Loading skeleton ───────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #273349 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Modal dialog ───────────────────────────────────────────────────────────── */
dialog {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 1.25rem;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
dialog::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(2px);
}

/* ── FAB ─────────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 100ms, box-shadow 100ms;
}
.fab:active { transform: scale(0.95); }

/* ── Colour-tinted class cards ─────────────────────────────────────────────── */
.class-card-accent {
  border-left: 6px solid var(--class-color);
}
.class-card-tint {
  background: color-mix(in srgb, var(--class-color) 10%, #1e293b);
}

/* ── Sticky footer ──────────────────────────────────────────────────────────── */
.sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: #0f172a;
  border-top: 1px solid #334155;
  padding: 0.75rem 1rem;
}

/* ── Edit mode tint ─────────────────────────────────────────────────────────── */
.edit-mode-bg {
  background: rgba(34, 197, 94, 0.04);
}

/* ── Pin dots ───────────────────────────────────────────────────────────────── */
.pin-input {
  letter-spacing: 0.3em;
  font-size: 1.5rem;
  text-align: center;
}

/* ── Drag handle ────────────────────────────────────────────────────────────── */
.drag-handle {
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-over { border: 2px dashed #6366f1; border-radius: 0.75rem; }

/* ── Admin nav tabs ─────────────────────────────────────────────────────────── */
.admin-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 100ms, color 100ms;
  color: #94a3b8;
}
.admin-tab.active, .admin-tab:hover { background: #273349; color: #e2e8f0; }
.admin-tab.active { color: #6366f1; }

/* ── Colour swatch ──────────────────────────────────────────────────────────── */
.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

/* ── Responsive sidebar / tabs ──────────────────────────────────────────────── */
@media (min-width: 768px) {
  .admin-sidebar { display: flex !important; }
  .admin-tabs-mobile { display: none !important; }
}
@media (max-width: 767px) {
  .admin-sidebar { display: none !important; }
  .admin-tabs-mobile { display: flex !important; }
}
