/* Sunrise Webapp — Design Tokens */
:root {
  /* Brand colors — teal palette (resolved from dead blue token layer) */
  --color-primary: #0d9488;
  /* teal-600 */
  --color-primary-dark: #0f766e;
  /* teal-700 */
  --color-primary-light: #5eead4;
  /* teal-300 */
  --color-primary-bg: #f0fdfa;
  /* teal-50 */

  /* Semantic tokens */
  --color-ink: #1c1917;
  /* foreground */
  --color-muted: #737373;
  /* muted foreground */
  --color-border: #e5e5e5;
  /* border/input */
  --color-bg: #ffffff;
  /* page background */
  --color-bg-alt: #f9fafb;
  /* gray-50 alternate bg */
  --color-ring: #14b8a6;
  /* teal-500 focus ring */

  /* Teal scale (for direct use where needed) */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  /* Gray scale */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Radius & spacing conventions */
  --radius: 0.3rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

body {
  background: var(--color-bg);
  color: var(--color-ink);
  min-height: 100dvh;
  font-family: 'Nunito Sans', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

html {
  font-family: 'Nunito Sans', sans-serif;
  scroll-behavior: smooth;
}

/* The body's font. A class, not an inline style: the content security
   policy allows no style attributes (API todo 107). */
.font-body {
  font-family: 'Nunito Sans', sans-serif;
}

/* Font utility for display headings — use as `class="font-display"` */
.font-display {
  font-family: 'Playfair Display', serif;
}

/* Selection */
::selection {
  background: var(--color-primary);
  color: white;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

/* HTMX transitions */
.htmx-indicator {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.htmx-indicator.htmx-request {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loading-bar {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  overflow: hidden;
  background: rgba(13, 148, 136, 0.15);
}

.page-loading-bar span {
  display: block;
  width: 35%;
  height: 100%;
  background: #0d9488;
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.65);
  animation: page-loading-slide 1.1s ease-in-out infinite;
}

@keyframes page-loading-slide {
  0% {
    transform: translateX(-120%);
  }

  55% {
    transform: translateX(220%);
  }

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

.htmx-settling {
  opacity: 0;
  transition: opacity 150ms ease-in;
}

.htmx-settling.htmx-settling {
  opacity: 1;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

.toast-success {
  background: var(--teal-50);
  color: var(--teal-800);
  border: 1px solid var(--teal-200);
}

.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

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

/* Loading spinner */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Image hover effects */
.img-hover-zoom {
  overflow: hidden;
}

.img-hover-zoom img {
  transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
  transform: scale(1.05);
}

/* Glass morphism */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Gradient overlays */
.gradient-overlay {
  position: relative;
}

.gradient-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
}