/* ZooHouse global theme (raw CSS) to ensure EJS pages get modern UI without Tailwind processing */
:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;

  --color-bg: oklch(99% 0 0);
  --color-fg: oklch(20% 0.02 265);
  --color-muted: oklch(96% 0.02 265);
  --color-muted-fg: oklch(40% 0.02 265);
  --color-border: oklch(90% 0.02 265);

  --color-accent: oklch(67% 0.15 210);
  --color-accent-fg: oklch(98% 0.02 210);

  --glass-bg: color-mix(in oklch, oklch(100% 0 0) 65%, transparent);
  --glass-border: oklch(88% 0.02 265 / 0.7);
  --glass-blur: 12px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.08);
}

.dark {
  --color-bg: oklch(18% 0.02 265);
  --color-fg: oklch(96% 0.02 265);
  --color-muted: oklch(24% 0.02 265);
  --color-muted-fg: oklch(80% 0.02 265);
  --color-border: oklch(34% 0.02 265 / 0.7);

  --glass-bg: color-mix(in oklch, oklch(24% 0.02 265) 40%, transparent);
  --glass-border: oklch(40% 0.02 265 / 0.6);
}

.light {
  --color-bg: oklch(99% 0 0);
  --color-fg: oklch(20% 0.02 265);
  --color-muted: oklch(96% 0.02 265);
  --color-muted-fg: oklch(40% 0.02 265);
  --color-border: oklch(90% 0.02 265);

  --glass-bg: color-mix(in oklch, oklch(100% 0 0) 65%, transparent);
  --glass-border: oklch(88% 0.02 265 / 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --color-bg: oklch(18% 0.02 265);
    --color-fg: oklch(96% 0.02 265);
    --color-muted: oklch(24% 0.02 265);
    --color-muted-fg: oklch(80% 0.02 265);
    --color-border: oklch(34% 0.02 265 / 0.7);

    --glass-bg: color-mix(in oklch, oklch(24% 0.02 265) 40%, transparent);
    --glass-border: oklch(40% 0.02 265 / 0.6);
  }
}

/* Surfaces and cards */
.surface-0 {
  background: var(--color-bg);
  color: var(--color-fg);
}
.surface-1 {
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.surface-2 {
  background: var(--glass-bg);
  color: var(--color-fg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.surface-3 {
  background: color-mix(in oklch, var(--glass-bg) 80%, transparent);
  color: var(--color-fg);
  backdrop-filter: blur(calc(var(--glass-blur) * 1.25));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
}
.card {
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

/* Pills and buttons */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}
.pill:hover {
  background: var(--color-muted);
  border-color: var(--color-accent);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding-inline: 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  outline: none;
  transition:
    color 150ms,
    background-color 150ms,
    border-color 150ms;
}
.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--color-accent);
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-fg);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding-inline: 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: oklch(62% 0.15 210);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: var(--color-fg);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding-inline: 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
}
.btn-ghost:hover {
  background: var(--color-muted);
}

/* Safe defaults for inputs inside glass areas */
.zh-input {
  height: 2.5rem;
  padding-inline: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
}
.zh-input::placeholder {
  color: var(--color-muted-fg);
}

/* Gentle global form defaults (do not affect checkboxes/radios) */
form input:not([type='checkbox']):not([type='radio']),
form select,
form textarea {
  appearance: none;
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

/* Utility helpers for spacing where Tailwind may be absent */
.zh-flex {
  display: flex;
}
.zh-items-center {
  align-items: center;
}
.zh-gap-2 {
  gap: 0.5rem;
}
.zh-gap-3 {
  gap: 0.75rem;
}
.zh-rounded-full {
  border-radius: 9999px;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .surface-2 {
    padding: 0.5rem;
  }

  .pill {
    padding: 0.125rem 0.5rem;
    font-size: 0.875rem;
  }

  .btn {
    height: 2.25rem;
    padding-inline: 0.75rem;
    font-size: 0.875rem;
  }

  .zh-input {
    height: 2.25rem;
    padding-inline: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Search Tab Styles */
.search-tab {
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.search-tab:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
}

.search-tab.active {
  color: #1f2937;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-tab.active:hover {
  color: #1f2937;
  background: rgba(255, 255, 255, 1);
}

/* Mobile responsive tabs */
@media (max-width: 768px) {
  .search-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
}
