@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

html {
  scroll-behavior: smooth;
}

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
  font-family: var(--font-sans);
  background-color: #ffffff;
  background-image: radial-gradient(at 50% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 600px);
  background-repeat: no-repeat;
  color: #171717;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dark body {
  background-color: #0a0a0a;
  background-image: radial-gradient(at 50% 0%, rgba(16, 185, 129, 0.09) 0px, transparent 700px);
  background-repeat: no-repeat;
  color: #f5f5f5;
}

::selection {
  background-color: #10b981;
  color: #ffffff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18) !important;
}

code, kbd, samp, pre, .font-mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   ANIMATION KEYFRAMES & UTILITIES (Silky Smooth Micro-Interactions)
   ========================================================================== */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

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

.animate-marquee {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

.marquee-mask {
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}


/* Entry Animation Utility Classes */
.animate-fade-in-up {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.35s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-float {
  animation: floatGentle 4s ease-in-out infinite;
}

.pulse-active {
  animation: pulseGlow 2.5s infinite;
}

/* Stagger Delays for Rich Content Entrance */
.delay-75  { animation-delay: 75ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-250 { animation-delay: 250ms; }
.delay-300 { animation-delay: 300ms; }

/* Modern Card & Component Hover Micro-Interactions */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
}

.hover-glow {
  transition: all 0.25s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.06);
}

/* Button Click Tactile Feedback */
button:active, a.btn:active, .tool-btn:active, .os-btn:active {
  transform: scale(0.97) !important;
  transition: transform 0.1s ease !important;
}

/* Smooth Links & Buttons Transitions */
a, button, input, select, textarea {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom Ollama Pill buttons & inputs */
.ollama-pill-input {
  background-color: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.ollama-pill-input:focus-within {
  background-color: #ffffff;
  border-color: #171717;
  box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.1);
}

/* Terminal window styling */
.ollama-terminal {
  background-color: #242424;
  border: 1px solid #383838;
  color: #e5e5e5;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .ollama-terminal {
  background-color: #1e1e1e;
  border-color: #333333;
  color: #f5f5f7;
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.25);
}

.ollama-terminal:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.18);
}

/* Inline emphasis inside the /tools step lists. The step text comes from
   i18n strings carrying <strong>/<code>, so the markup is styled here
   rather than with utility classes on each element. */
.tool-doc-section li strong,
.tool-doc-section p strong {
  font-weight: 600;
  color: #171717;
}

html.dark .tool-doc-section li strong,
html.dark .tool-doc-section p strong {
  color: #f5f5f7;
}

.tool-doc-section li code,
.tool-doc-section p code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 0.375rem;
  background-color: #f5f5f5;
  border: 1px solid #e5e5e5;
  color: #171717;
  overflow-wrap: anywhere;
}

html.dark .tool-doc-section li code,
html.dark .tool-doc-section p code {
  background-color: #262626;
  border-color: #3f3f3f;
  color: #e5e5e5;
}

/* Inside the amber "note" callout the neutral palette above would fight
   the warning colour, so emphasis there just inherits it. */
.tool-doc-section p.text-amber-800 strong,
.tool-doc-section p.text-amber-800 code {
  color: inherit;
  background-color: rgba(180, 83, 9, 0.08);
  border-color: rgba(180, 83, 9, 0.2);
}

html.dark .tool-doc-section p.text-amber-800 strong,
html.dark .tool-doc-section p.text-amber-800 code {
  background-color: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
}

.tool-doc-section p.text-amber-800 strong {
  background-color: transparent;
  border: 0;
}

.ollama-card {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.ollama-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.06);
}

/* Rounded pills & tags */
.ollama-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #525252;
}

/* HTMX Instant Page Transitions (No flashing) */
.htmx-swapping {
  opacity: 1;
}
.htmx-settling {
  opacity: 1;
}

.bg-mesh-gradient {
  background-image: none;
}

.dark .ollama-card {
  background-color: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
}

.dark .ollama-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
}

.dark .ollama-badge {
  border-color: rgba(39, 39, 42, 0.8);
  background-color: rgba(24, 24, 27, 0.8);
  color: #a1a1aa;
}

.dark ::-webkit-scrollbar-thumb {
  background: #27272a;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Scrollbar polish */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

/* Click feedback for hx-boosted links/forms */
.htmx-request {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}
/* Tooltip for icon buttons */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  white-space: nowrap;
  background-color: #18181b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 40;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dark [data-tooltip]::after {
  background-color: #f4f4f5;
  color: #18181b;
}

/* Custom Money / Amount & Number Display Typography */
.font-number,
.amount-display-style {
  font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif !important;
  font-style: normal !important;
  font-weight: 500;
  color: rgb(15, 17, 21);
}
.dark .font-number,
.dark .amount-display-style {
  color: #ffffff;
}

.amount-hero-size,
.amount-display-style {
  font-size: 29px;
  line-height: 36px;
}

/* ==========================================================================
   PAGE TITLE TYPOGRAPHY (Logged-in Pages & Dashboards)
   ========================================================================== */
.page-title,
#main-workspace-content h1:not(.page-title-inverse) {
  font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif !important;
  font-style: normal !important;
  font-weight: 500 !important;
  font-size: 24px !important;
  line-height: 32px !important;
  color: rgb(15, 17, 21);
}

.dark .page-title,
.dark #main-workspace-content h1:not(.page-title-inverse) {
  color: #ffffff;
}

.page-title-inverse,
#main-workspace-content .bg-neutral-900 h1,
#main-workspace-content .bg-neutral-950 h1 {
  font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif !important;
  font-style: normal !important;
  font-weight: 500 !important;
  font-size: 24px !important;
  line-height: 32px !important;
  color: #ffffff !important;
}

/* Standard body copy for logged-in pages (page subtitles, descriptions) */
.page-subtitle {
  font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif !important;
  font-style: normal !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  line-height: 22px !important;
  color: rgb(129, 133, 140) !important;
}

.dark .page-subtitle {
  color: rgb(156, 163, 175) !important;
}

/* ==========================================================================
   PILL BUTTONS (Logged-in Pages & Dashboards)
   ========================================================================== */
.btn-pill-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background-color: rgb(15, 17, 21);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
}
.btn-pill-primary:hover {
  background-color: #232730;
}
.btn-pill-primary:active {
  transform: scale(0.97);
}
.btn-pill-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dark .btn-pill-primary {
  background-color: #ffffff;
  color: rgb(15, 17, 21);
}
.dark .btn-pill-primary:hover {
  background-color: #e5e5e5;
}

.btn-pill-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background-color: #ffffff;
  color: rgb(15, 17, 21);
  border: 1px solid #e5e5e5;
  font-size: 13px;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
}
.btn-pill-secondary:hover {
  background-color: #f5f6f8;
}
.btn-pill-secondary:active {
  transform: scale(0.97);
}
.btn-pill-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dark .btn-pill-secondary {
  background-color: #161d2d;
  color: #ffffff;
  border-color: #27272a;
}
.dark .btn-pill-secondary:hover {
  background-color: #1f293d;
}

/* ==========================================================================
   CLEAN DATA TABLE (Logged-in Pages & Dashboards)
   ========================================================================== */
.table-clean {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  font-size: 14px;
}
.table-clean thead {
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}
.table-clean th {
  padding: 0.75rem 1.25rem;
  font-size: 13px;
  font-weight: 500;
  color: rgb(129, 133, 140);
  white-space: nowrap;
}
.table-clean td {
  padding: 0.875rem 1.25rem;
  color: rgb(15, 17, 21);
  vertical-align: middle;
}
.table-clean tbody tr {
  border-bottom: 1px solid #f3f4f6;
}
.table-clean tbody tr:last-child {
  border-bottom: none;
}
.dark .table-clean thead {
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.dark .table-clean th {
  color: rgb(156, 163, 175);
}
.dark .table-clean td {
  color: #ffffff;
}
.dark .table-clean tbody tr {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   SKELETON LOADER ANIMATIONS & COMPONENTS
   ========================================================================== */
@keyframes shimmerSweep {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, 
    rgba(229, 231, 235, 0.55) 25%, 
    rgba(243, 244, 246, 0.95) 37%, 
    rgba(229, 231, 235, 0.55) 63%
  );
  background-size: 200% 100%;
  animation: shimmerSweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: 0.5rem;
}

.dark .skeleton-shimmer {
  background: linear-gradient(90deg, 
    rgba(38, 38, 38, 0.6) 25%, 
    rgba(64, 64, 64, 0.85) 37%, 
    rgba(38, 38, 38, 0.6) 63%
  );
  background-size: 200% 100%;
}

.skeleton-card {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 1rem;
}

.dark .skeleton-card {
  background-color: rgba(23, 23, 23, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}
