@import "tailwindcss";

/* ═══════════════════════════════════════════════════════════════════
   90mod — Calm Design System
   Charcoal + off-white palette. Peaceful, intentional, focused.
   ═══════════════════════════════════════════════════════════════════ */

@theme {
  --color-mod-bg: #f6f4f1;
  --color-mod-bg-alt: #edeae5;
  --color-mod-surface: #ffffff;
  --color-mod-charcoal: #1a1a2e;
  --color-mod-charcoal-light: #2d2d44;
  --color-mod-charcoal-soft: #3d3d56;
  --color-mod-text: #1a1a2e;
  --color-mod-text-secondary: #4a4a5a;
  --color-mod-text-muted: #7a7a8a;
  --color-mod-border: #e2ddd6;
  --color-mod-border-focus: #c8c1b8;
  --color-mod-warm-50: #faf8f6;
  --color-mod-warm-100: #f6f4f1;
  --color-mod-warm-200: #edeae5;
  --color-mod-warm-300: #e2ddd6;
  --color-mod-warm-400: #c8c1b8;
  --color-mod-warm-500: #a0a0aa;
  --color-mod-warm-600: #7a7a8a;
  --color-mod-warm-700: #4a4a5a;
  --color-mod-warm-800: #2d2d44;
  --color-mod-warm-900: #1a1a2e;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
#sidebar {
  background: var(--color-mod-charcoal) !important;
}

#sidebar nav a {
  border-radius: 8px;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

#sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

/* ── Input Focus ───────────────────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
  border-color: var(--color-mod-charcoal-soft) !important;
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08) !important;
  outline: none;
}

/* ── Page Transitions ──────────────────────────────────────────────── */
main {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-mod-warm-400);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-mod-warm-500);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-mod-warm-400) transparent;
}

/* ── Card Interactions ─────────────────────────────────────────────── */
.bg-white {
  transition: box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Button Micro-interactions ─────────────────────────────────────── */
button, [type="submit"], a[class*="rounded-lg"] {
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

button:active, [type="submit"]:active {
  transform: scale(0.97);
}

/* ── Table Row Hover ───────────────────────────────────────────────── */
tbody tr {
  transition: background-color 150ms ease;
}

tbody tr:hover {
  background-color: var(--color-mod-warm-50);
}

/* ── Link Underline Animation ──────────────────────────────────────── */
a[class*="hover:underline"] {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 300ms ease;
}

a[class*="hover:underline"]:hover {
  background-size: 100% 1px;
}

/* ── Stat Number Pulse ─────────────────────────────────────────────── */
.text-3xl.font-semibold {
  transition: color 200ms ease;
}

/* ── Stagger Animation for Cards ───────────────────────────────────── */
.grid > div:nth-child(1) { animation-delay: 0s; }
.grid > div:nth-child(2) { animation-delay: 0.05s; }
.grid > div:nth-child(3) { animation-delay: 0.1s; }
.grid > div:nth-child(4) { animation-delay: 0.15s; }
.grid > div:nth-child(5) { animation-delay: 0.2s; }
.grid > div:nth-child(6) { animation-delay: 0.25s; }

.grid > div {
  animation: cardReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Focus Glow ────────────────────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08) !important;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

/* ── Sidebar Active Indicator ──────────────────────────────────────── */
#sidebar nav a[class*="bg-white"] {
  position: relative;
}

#sidebar nav a[class*="bg-white"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: white;
  border-radius: 0 2px 2px 0;
}

/* ── Topbar Shadow on Scroll (handled by CSS — works with sticky) ── */
header.sticky {
  transition: box-shadow 300ms ease;
}

/* ── Selection Color ───────────────────────────────────────────────── */
::selection {
  background: rgba(26, 26, 46, 0.12);
  color: var(--color-mod-charcoal);
}
