/* ── App Identity ─────────────────────────────────────────── */
:root {
  --vopts-app-hue: 210;
}

/* ShopMaint — Industrial control panel aesthetic
 * Typography: Red Hat Display (headings), Red Hat Text (body), Fira Mono (data)
 * Palette: DaisyUI theme colors + status indicators (red/amber/green)
 * Target: 375px mobile, greasy hands, 44px+ touch targets */

@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@400;500;700;900&family=Red+Hat+Text:wght@400;500;700&family=Fira+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════
   Typography Custom Properties
   ═══════════════════════════════════════ */

:root {
  /* Typography pairing: geometric (default for ShopMaint) */
  --vopts-font-display: "Red Hat Display", system-ui, sans-serif;
  --vopts-font-body: "Red Hat Text", system-ui, sans-serif;
  --vopts-font-mono: "Fira Mono", ui-monospace, monospace;
}

/* ═══════════════════════════════════════
   Typography
   ═══════════════════════════════════════ */

body {
  font-family: var(--vopts-font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--vopts-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.font-mono, code, [data-readout] {
  font-family: var(--vopts-font-mono);
}

/* Auth page brand mark */
.auth-brand {
  font-family: var(--vopts-font-display);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ═══════════════════════════════════════
   Status Summary Bar (dashboard top)
   ═══════════════════════════════════════ */

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.status-bar-item {
  text-align: center;
  padding: 1rem 0.5rem;
  border-radius: 0.75rem;
}

.status-bar-count {
  font-family: var(--vopts-font-display);
  font-weight: 900;
  font-size: 2.25rem;
  line-height: 1;
}

.status-bar-label {
  font-family: var(--vopts-font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* ═══════════════════════════════════════
   Status Indicator Dots
   ═══════════════════════════════════════ */

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-overdue {
  background-color: oklch(0.637 0.237 25.331);
  animation: pulse-glow 2s ease-in-out infinite;
}

.status-dot-warning {
  background-color: oklch(0.795 0.184 86.047);
}

.status-dot-ok {
  background-color: oklch(0.765 0.177 163.223);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.637 0.237 25.331 / 0.4); }
  50% { box-shadow: 0 0 0 6px oklch(0.637 0.237 25.331 / 0); }
}

/* ═══════════════════════════════════════
   Status Section Cards (colored left border)
   ═══════════════════════════════════════ */

.status-card {
  border-left: 4px solid transparent;
}

.status-card-overdue { border-left-color: oklch(0.637 0.237 25.331); }
.status-card-warning { border-left-color: oklch(0.795 0.184 86.047); }
.status-card-ok { border-left-color: oklch(0.765 0.177 163.223); }

/* ═══════════════════════════════════════
   Task Rows
   ═══════════════════════════════════════ */

.task-row {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.task-row:hover {
  background-color: oklch(0 0 0 / 0.04);
}

[data-theme="dark"] .task-row:hover,
[data-theme="business"] .task-row:hover,
[data-theme="night"] .task-row:hover,
[data-theme="forest"] .task-row:hover,
[data-theme="dracula"] .task-row:hover,
[data-theme="coffee"] .task-row:hover,
[data-theme="dim"] .task-row:hover,
[data-theme="sunset"] .task-row:hover,
[data-theme="abyss"] .task-row:hover {
  background-color: oklch(1 0 0 / 0.04);
}

/* Done button — large touch target */
.btn-done {
  min-width: 72px;
  min-height: 44px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-done.htmx-request {
  pointer-events: none;
}

/* Smooth swap transition for task rows */
.task-row-swap {
  transition: opacity 0.15s ease;
}
.task-row-swap.htmx-swapping {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ═══════════════════════════════════════
   Staggered Page Load Animation
   ═══════════════════════════════════════ */

.stagger > * {
  opacity: 0;
  animation: slide-up 0.35s ease forwards;
}

.stagger > :nth-child(1) { animation-delay: 0ms; }
.stagger > :nth-child(2) { animation-delay: 60ms; }
.stagger > :nth-child(3) { animation-delay: 120ms; }
.stagger > :nth-child(4) { animation-delay: 180ms; }
.stagger > :nth-child(5) { animation-delay: 240ms; }
.stagger > :nth-child(6) { animation-delay: 300ms; }
.stagger > :nth-child(7) { animation-delay: 360ms; }
.stagger > :nth-child(8) { animation-delay: 420ms; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   Subtle Grain Texture
   ═══════════════════════════════════════ */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════
   Equipment Cards
   ═══════════════════════════════════════ */

.equipment-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.equipment-card:hover {
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.1);
}

/* ═══════════════════════════════════════
   Type Badge
   ═══════════════════════════════════════ */

.type-badge {
  font-family: var(--vopts-font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background-color: oklch(0 0 0 / 0.06);
}

[data-theme="dark"] .type-badge,
[data-theme="business"] .type-badge,
[data-theme="night"] .type-badge {
  background-color: oklch(1 0 0 / 0.08);
}

/* ═══════════════════════════════════════
   Nav Brand Override
   ═══════════════════════════════════════ */

.app-nav .nav-brand,
.app-topbar a.font-bold {
  font-family: var(--vopts-font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
}

/* ═══════════════════════════════════════
   Form Polish
   ═══════════════════════════════════════ */

.form-control .label .label-text {
  font-weight: 500;
  letter-spacing: 0.01em;
}
