/*
 * TestEzy — global stylesheet
 * Tailwind is loaded via CDN (play-CDN) in the layouts for utility classes;
 * this file only carries what Tailwind's CDN build can't: custom keyframe
 * animations for the toast/modal/dialog system in ui.js, font setup, and a
 * handful of small polish details (scrollbars, focus rings, selection color)
 * shared across every page.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --brand-50: #f0f9ff;
  --brand-500: #0284c7;
  --brand-600: #0369a1;
  --brand-700: #075985;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

/*
 * Dark-mode safety net for plain form controls.
 *
 * Most surfaces (cards, panels, headers) get their dark colors from
 * Tailwind `dark:` utility classes directly on the element. But a bare
 * <input>/<select>/<textarea> with no explicit bg-* class (there are many
 * across the admin CRUD forms and checkout) otherwise falls back to the
 * browser's default white field background, which looks broken on a dark
 * page. This single rule covers all of them at once instead of having to
 * touch every form field individually.
 */
html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
  background-color: #1e293b; /* slate-800 */
  color: #f1f5f9; /* slate-100 */
  border-color: #334155; /* slate-700 */
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b; /* slate-500 */
}

html.dark input:focus-visible,
html.dark select:focus-visible,
html.dark textarea:focus-visible {
  outline-color: #38bdf8; /* sky-400 — brighter than the light-mode sky-500 so it stays visible on dark fields */
}

body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #bae6fd;
  color: #0c4a6e;
}

html.dark ::selection {
  background: #075985;
  color: #e0f2fe;
}

/* Focus visibility for keyboard users, without adding a ring to every
   mouse click (Tailwind's default outline removal otherwise leaves
   inputs/buttons with no visible focus state at all). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Thin, unobtrusive scrollbars for horizontally-scrolling tables/rails. */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
html.dark .custom-scrollbar::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #475569;
}
html.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Fully hidden scrollbar for horizontally-scrollable rails that should
   still be swipeable on mobile (announcement bar, top navbar, category
   filter chips) without a visible scrollbar cluttering the UI. */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Same shimmer, dark-appropriate tones so loading skeletons don't flash
   bright white on a dark page. */
html.dark .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 37%, #1e293b 63%);
  background-size: 800px 100%;
}

html.dark .card-lift:hover {
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------------ */
/* Toast notifications (public/assets/js/ui.js -> toast())             */
/* ------------------------------------------------------------------ */

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 200px;
    margin-bottom: 0.5rem;
  }
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    max-height: 0;
    margin-bottom: 0;
  }
}

.toast-enter {
  animation: toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast-exit {
  animation: toast-out 180ms ease-in both;
  overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Modal / confirm dialog pop-in (used by ui.js confirmDialog() and     */
/* every admin CRUD modal across views/admin/*.php)                    */
/* ------------------------------------------------------------------ */

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-pop {
  animation: modal-pop-in 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ------------------------------------------------------------------ */
/* Small general-purpose motion utilities used sparingly across pages  */
/* ------------------------------------------------------------------ */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fade-in-up 260ms ease-out both;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* Card lift used on catalog/test cards for a subtle hover response. */
.card-lift {
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.card-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.15);
}

/* Print styles for report/booking confirmation pages */
@media print {
  .no-print {
    display: none !important;
  }
}
