@import "tailwindcss";

:root {
  --background: #141a14;
  --foreground: #e8ecd8;

  /* Core earth & vine palette */
  --ampelos-ink: #0e1410;
  --ampelos-earth: #182018;
  --ampelos-clay: #384030;
  --ampelos-mortar: #5e6e52;
  --ampelos-stone: #88988a;
  --ampelos-stone-soft: #a8b8a8;
  --ampelos-parchment: #e8ecd8;
  --ampelos-muted: #a8b890;
  --ampelos-gold: #98aa58;
  --ampelos-gold-strong: #687038;

  /* Grape & vine accents */
  --ampelos-wine: #382848;
  --ampelos-wine-soft: #5a4878;
  --ampelos-grape: #7080a8;
  --ampelos-vine: #3a5028;
  --ampelos-sage: #5e7840;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-ampelos-ink: var(--ampelos-ink);
  --color-ampelos-earth: var(--ampelos-earth);
  --color-ampelos-clay: var(--ampelos-clay);
  --color-ampelos-mortar: var(--ampelos-mortar);
  --color-ampelos-stone: var(--ampelos-stone);
  --color-ampelos-stone-soft: var(--ampelos-stone-soft);
  --color-ampelos-parchment: var(--ampelos-parchment);
  --color-ampelos-muted: var(--ampelos-muted);
  --color-ampelos-gold: var(--ampelos-gold);
  --color-ampelos-gold-strong: var(--ampelos-gold-strong);
  --color-ampelos-wine: var(--ampelos-wine);
  --color-ampelos-wine-soft: var(--ampelos-wine-soft);
  --color-ampelos-grape: var(--ampelos-grape);
  --color-ampelos-vine: var(--ampelos-vine);
  --color-ampelos-sage: var(--ampelos-sage);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ampelos-ink);
}

body {
  min-height: 100vh;
  background-color: #141a14;
  background-image:
    radial-gradient(ellipse at 22% 0%,  rgba(90,  120, 55,  0.18), transparent 34rem),
    radial-gradient(circle at 80% 82%,  rgba(80,  60,  110, 0.18), transparent 28rem),
    radial-gradient(circle at 6%  74%,  rgba(55,  80,  40,  0.14), transparent 22rem),
    linear-gradient(180deg, #1a2218 0%, #141a14 52%, #0e1410 100%);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

/* Subtle vine-row texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.30;
  background-image:
    linear-gradient(162deg, rgba(160, 185, 120, 0.07) 0 1px, transparent 1px 80px),
    linear-gradient(68deg,  rgba(14,  20,  16,  0.22) 0 1px, transparent 1px 60px),
    radial-gradient(ellipse at 18% 40%, rgba(90, 120, 55, 0.07), transparent 22rem),
    radial-gradient(circle  at 76% 68%, rgba(80, 60, 110, 0.06), transparent 18rem);
  background-size: 160px 160px, 112px 112px, auto, auto;
  mix-blend-mode: soft-light;
}

.ampelos-app {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background-color: #161c16;
  background-image:
    radial-gradient(ellipse at 18% 0%,  rgba(90,  120, 55,  0.20), transparent 32rem),
    radial-gradient(circle at 88%  6%,  rgba(80,  60,  110, 0.18), transparent 24rem),
    radial-gradient(circle at 54% 84%,  rgba(55,  80,  40,  0.16), transparent 28rem),
    linear-gradient(180deg, rgba(30, 40, 28, 0.95), rgba(20, 26, 18, 0.98));
}

.ampelos-login {
  position: relative;
  isolation: isolate;
  background: var(--ampelos-ink);
}

.ampelos-login__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(14, 20, 16, 0.94) 0%, rgba(14, 20, 16, 0.78) 36%, rgba(14, 20, 16, 0.28) 68%, rgba(14, 20, 16, 0.62) 100%),
    radial-gradient(circle at 30% 30%, rgba(90, 120, 55,  0.18), transparent 22rem),
    radial-gradient(circle at 72% 22%, rgba(80, 60,  110, 0.22), transparent 24rem),
    radial-gradient(circle at 60% 76%, rgba(55, 80,  40,  0.14), transparent 22rem),
    url("/vineyard.webp");
  background-position: center;
  background-size: cover;
  filter: saturate(0.92) contrast(1.06) brightness(0.90);
}

.ampelos-login__background::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(108deg, rgba(160, 185, 120, 0.05) 0 1px, transparent 1px 60px),
    radial-gradient(circle at 22% 22%, rgba(90, 120, 55,  0.10), transparent 18rem),
    radial-gradient(circle at 74% 66%, rgba(80, 60,  110, 0.10), transparent 22rem);
  mix-blend-mode: soft-light;
}

/* Surfaces: aged stone slab / terracotta */
.ampelos-topbar,
.ampelos-panel,
.ampelos-card,
.ampelos-surface {
  border: 1px solid rgba(140, 160, 110, 0.20);
  background-color: #1e2a1e;
  background-image:
    radial-gradient(circle at 16% 0%,  rgba(90,  120, 55,  0.15), transparent 18rem),
    radial-gradient(circle at 88% 88%, rgba(80,  60,  110, 0.16), transparent 16rem),
    repeating-linear-gradient(
      108deg,
      transparent,
      transparent 14px,
      rgba(0, 0, 0, 0.020) 14px,
      rgba(0, 0, 0, 0.020) 15px
    ),
    linear-gradient(180deg, rgba(38, 50, 34, 0.94), rgba(22, 30, 20, 0.98));
  background-blend-mode: normal, normal, soft-light, normal;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(160, 185, 120, 0.11);
}

.ampelos-topbar {
  border-width: 0 0 1px;
  background-color: #192019;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(90,  120, 55,  0.14), transparent 26rem),
    radial-gradient(circle at 90% 0%, rgba(80,  60,  110, 0.12), transparent 20rem),
    linear-gradient(90deg, rgba(28, 38, 26, 0.97), rgba(22, 32, 20, 0.95));
}

.ampelos-panel,
.ampelos-card,
.ampelos-surface {
  border-radius: 6px;
}

.ampelos-card {
  overflow: hidden;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.ampelos-card:hover {
  border-color: rgba(140, 165, 100, 0.38);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(160, 185, 120, 0.13);
}

.ampelos-input {
  border: 1px solid rgba(140, 160, 100, 0.32);
  background: rgba(14, 20, 16, 0.68);
  color: var(--ampelos-parchment);
}

.ampelos-input::placeholder {
  color: rgba(168, 184, 144, 0.60);
}

.ampelos-input:focus {
  outline: none;
  border-color: rgba(152, 170, 88, 0.68);
  box-shadow: 0 0 0 3px rgba(152, 170, 88, 0.16);
}

/* Primary button: beveled stone slab */
.ampelos-stone-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;

  background-image:
    linear-gradient(
      180deg,
      #b4c4a8 0%,
      #94a888 46%,
      #7a9070 100%
    );

  /* Embossed bevel: bright top-left, dark bottom-right */
  border-top:    2px solid rgba(255, 255, 255, 0.58);
  border-left:   1px solid rgba(255, 255, 255, 0.28);
  border-right:  1px solid rgba(0,   0,   0,   0.24);
  border-bottom: 2px solid rgba(0,   0,   0,   0.48);

  color: #141c12;
  font-weight: 700;

  box-shadow:
    0 2px 5px  rgba(0, 0, 0, 0.52),
    0 6px 20px rgba(0, 0, 0, 0.28),
    inset 0  1px 0   rgba(255, 255, 255, 0.62),
    inset 0 -3px 6px rgba(0,   0,   0,   0.16);

  transition: filter 100ms ease, box-shadow 100ms ease, transform 80ms ease;
}

.ampelos-stone-button:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 3px 7px  rgba(0, 0, 0, 0.56),
    0 8px 24px rgba(0, 0, 0, 0.32),
    inset 0  1px 0   rgba(255, 255, 255, 0.68),
    inset 0 -3px 6px rgba(0,   0,   0,   0.12);
}

.ampelos-stone-button:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(0.90);
  /* reverse bevel: pushed down into the ground */
  border-top:    2px solid rgba(0,   0,   0,   0.32);
  border-left:   1px solid rgba(0,   0,   0,   0.18);
  border-right:  1px solid rgba(255, 255, 255, 0.20);
  border-bottom: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 2px rgba(0, 0, 0, 0.28),
    inset 0  2px 6px rgba(0, 0, 0, 0.30),
    inset 0 -1px 0   rgba(255, 255, 255, 0.14);
}

/* Disabled/already-added: sunken into the ground, dimmed */
.ampelos-stone-button:disabled {
  cursor: default;
  background-image:
    linear-gradient(180deg, #788870 0%, #647860 100%);
  border-top:    2px solid rgba(0,   0,   0,   0.24);
  border-left:   1px solid rgba(0,   0,   0,   0.14);
  border-right:  1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.30),
    0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(20, 28, 18, 0.48);
}

/* Ghost button: mortared stone edge */
.ampelos-ghost-button {
  border-radius: 5px;
  border: 1px solid rgba(140, 165, 100, 0.28);
  background: rgba(14, 20, 16, 0.42);
  color: var(--ampelos-muted);
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.ampelos-ghost-button:hover {
  border-color: rgba(152, 170, 88, 0.55);
  background: rgba(152, 170, 88, 0.10);
  color: var(--ampelos-parchment);
}


/* Admin palette: readable operational UI. Kept as plain CSS so Tailwind never drops it. */
.ampelos-admin {
  min-height: 100vh;
  background: #0d1518;
  color: #f4f8f1;
}

.ampelos-admin-sidebar {
  background: #111c1f;
  border-right: 1px solid rgba(151, 185, 191, 0.34);
  color: #f4f8f1;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.36);
}

.admin-panel,
.admin-card {
  border: 1px solid rgba(151, 185, 191, 0.30);
  border-radius: 6px;
  background: #172629;
  color: #f4f8f1;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.admin-card {
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.admin-card:hover {
  border-color: rgba(159, 197, 209, 0.58);
  background: #1d3034;
  transform: translateY(-1px);
}

.admin-nav-button {
  display: block;
  border-radius: 5px;
  border: 1px solid rgba(151, 185, 191, 0.30);
  background: #172629;
  color: #f4f8f1;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.admin-nav-button:hover {
  border-color: rgba(159, 197, 209, 0.68);
  background: #20363a;
  color: #ffffff;
}

/* The selected item in a group: the sidebar's current page, inventory's
   Movies/Television and tier pickers, the calendar's scope.

   Filled rather than tinted. A row of outlined buttons where the active one
   merely has a slightly brighter outline does not read as "this one is on" at
   a glance -- which is the entire job of the control. Inverting the fill makes
   the state legible from across the room and survives being glanced at.

   Driven off aria-current, which these controls already set, so the selected
   look and the state announced to a screen reader cannot drift apart. */
.admin-nav-button[aria-current]:not([aria-current="false"]) {
  border-color: #9fc5d1;
  background: #9fc5d1;
  color: #0d1b1e;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 10px rgba(159, 197, 209, 0.20);
}

.admin-nav-button[aria-current]:not([aria-current="false"]):hover {
  border-color: #d8f3fa;
  background: #d8f3fa;
  color: #0d1b1e;
}

/* Nested spans inherit the admin text colour by default, which would keep the
   pale foreground against the now-pale fill. */
.admin-nav-button[aria-current]:not([aria-current="false"]) :is(span, p) {
  color: inherit;
}

.text-admin-text,
.ampelos-admin :is(h1, h2, h3, .font-medium, .font-semibold, .font-bold) {
  color: #f4f8f1;
}

.text-admin-muted {
  color: #c7d6cf;
}

.text-admin-accent,
a.text-admin-accent {
  color: #9fc5d1;
}

a.text-admin-accent:hover {
  color: #d8f3fa;
}

.text-admin-good {
  color: #b7d69a;
}

.border-admin-line {
  border-color: rgba(151, 185, 191, 0.26);
}

.divide-admin-line > :not(:last-child) {
  border-color: rgba(151, 185, 191, 0.22);
}

.bg-admin-subpanel {
  background: #102023;
}

.text-admin-warn {
  color: #e0c27a;
}

/* Border variants matching the text tokens above. border-admin-accent was
   already used by the inventory table but had no definition. */
.border-admin-accent {
  border-color: rgba(159, 197, 209, 0.62);
}

.border-admin-good {
  border-color: rgba(183, 214, 154, 0.58);
}

.border-admin-warn {
  border-color: rgba(224, 194, 122, 0.58);
}

/* Episode rows for which no file exists on any tier. */
.bg-admin-missing {
  background: rgba(126, 168, 116, 0.16);
}

.ampelos-admin :is(p, span, div, a, button) {
  text-shadow: none;
}
