/* ============================================================
   VINdown Design System — styles.css
   Tailwind CSS v3 CDN + Custom Design Tokens
   ============================================================ */

/* Tailwind CSS CDN (standalone build) */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@3.4.17/src/css/preflight.css');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  --cf-radius: 1rem;
  --cf-radius-lg: 1.5rem;
  --cf-glass-bg: rgba(255, 255, 255, 0.75);
  --cf-glass-border: rgba(255, 255, 255, 0.2);
  --cf-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 24px rgba(0, 0, 0, 0.04);
  --cf-shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
  --cf-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --cf-glass-bg: rgba(15, 23, 42, 0.75);
  --cf-glass-border: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   GLASSMORPHISM CARD SYSTEM
   ============================================================ */
.cf-card-glass {
  background: var(--cf-glass-bg);
  border: 1px solid var(--cf-glass-border);
  border-radius: var(--cf-radius);
  /* Reduced blur for better scroll perf — creates its own composite layer */
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: var(--cf-shadow);
  transition: box-shadow var(--cf-transition);
  /* Contain layout/paint so backdrop-filter doesn't dirty the entire page */
  contain: layout style;
  will-change: backdrop-filter;
}

.cf-card-glass:hover {
  box-shadow: var(--cf-shadow-lg);
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */
.cf-btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all var(--cf-transition);
  text-decoration: none;
}

.cf-btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}

.cf-btn-accent-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--cf-transition);
  text-decoration: none;
}

.cf-btn-accent-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.cf-btn-outline-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0ea5e9;
  background: transparent;
  border: 1px solid #0ea5e9;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--cf-transition);
  text-decoration: none;
}

.cf-btn-outline-sm:hover {
  background: rgba(14, 165, 233, 0.1);
}

/* ============================================================
   INPUT SYSTEM
   ============================================================ */
.cf-input-mono-sm {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: inherit;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color var(--cf-transition), background var(--cf-transition);
}

.cf-input-mono-sm:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.dark .cf-input-mono-sm {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
body {
  font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-soft {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-pulse-soft {
  animation: pulse-soft 2s ease-in-out infinite;
}

/* Skeleton loading placeholder */
.cf-skeleton {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 0%, rgba(148, 163, 184, 0.2) 50%, rgba(148, 163, 184, 0.1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
  /* Isolate shimmer animation to its own paint layer */
  contain: paint;
  will-change: background-position;
}

/* ============================================================
   SCROLL & INTERACTION
   ============================================================ */
/* Only enable smooth scroll for users who haven't opted for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Offscreen table rows: skip paint until visible */
.cf-table-row {
  content-visibility: auto;
  contain-intrinsic-size: 0 48px;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* ============================================================
   RESPONSIVE TABLE
   ============================================================ */
.cf-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   LIGHTNING UX: PROGRESS & TRANSITIONS
   ============================================================ */
#cf-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(to right, #0ea5e9, #6366f1);
  z-index: 9999;
  transition: width 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
}

.cf-loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.cf-searching::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border: 2px solid #0ea5e9;
  border-top-color: transparent;
  border-radius: 50%;
  animation: cf-spin 0.6s linear infinite;
}

@keyframes cf-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@view-transition {
  navigation: auto;
  /* Enable native view transitions if supported */
}

/* ============================================================
   DARK MODE TRANSITIONS
   ============================================================ */
/* Only transition background on explicit theme toggle, not on every paint */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}