/* =========================================================================
   Soulful Blooms Flower Farm — styles
   "Emerald Glass": deep emerald/teal background, frosted glass surfaces,
   warm gold accents. Modern glassmorphism aesthetic.
   ========================================================================= */

:root {
  /* Background */
  --emerald-deep: #0b3b2e;
  --emerald: #10564a;
  --teal: #0f6e63;

  /* Soft color "blooms" diffused behind the glass */
  --blob-emerald: rgba(45, 212, 167, 0.45);
  --blob-lime: rgba(163, 230, 53, 0.28);
  --blob-gold: rgba(252, 211, 77, 0.26);

  /* Glass surfaces */
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-bg-strong: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.28);
  --glass-blur: 16px;
  --glass-fallback: rgba(13, 54, 44, 0.88); /* when backdrop-filter unsupported */

  /* Text */
  --ink: #eafff7;
  --muted: rgba(234, 255, 247, 0.72);

  /* Accents + status */
  --accent: #ffd773;
  --accent-ink: #16352b;
  --emerald-bright: #15a47b;
  --badge-out-bg: rgba(11, 40, 33, 0.5);
  --red: #ff8a85;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 16px 42px rgba(0, 0, 0, 0.32);
  --radius: 18px;

  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute must always win. Class selectors that set a
   `display` value (e.g. .btn{display:inline-block}) would otherwise override
   the browser's default [hidden]{display:none} and leave it visible. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.6;
  color-scheme: dark; /* native controls (file input, scrollbars) render dark */
  background:
    linear-gradient(160deg, var(--emerald-deep) 0%, var(--emerald) 55%, var(--teal) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Soft, colorful blurred "blooms" sitting behind all content for the glass to
   refract. Fixed so they stay put while scrolling. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vw 42vw at 10% 6%, var(--blob-emerald), transparent 60%),
    radial-gradient(40vw 40vw at 90% 16%, var(--blob-lime), transparent 60%),
    radial-gradient(46vw 46vw at 72% 96%, var(--blob-gold), transparent 60%);
}

h1, h2, h3 { font-family: var(--font-head); margin: 0; }

a { color: inherit; }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* ----------------------------- Buttons ---------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  /* Large tap target for mobile */
  min-height: 48px;
}
.btn:active { transform: scale(0.97); }

/* Primary marketing CTA — solid gold so it pops off the glass. */
.btn--call { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
/* Secondary CTA — frosted glass. */
.btn--text {
  background: var(--glass-bg);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn--call:hover, .btn--text:hover { box-shadow: var(--shadow-hover); }
.btn--text:hover { background: var(--glass-bg-strong); }

/* Primary action button (admin) — solid emerald. */
.btn--primary { background: var(--emerald-bright); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: #128a67; }

/* Glass outline button (admin header link, manage toggle/edit). */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--glass-border);
}
.btn--ghost:hover { background: var(--glass-bg); }

.btn--block { display: block; width: 100%; }

/* Android Material Design recommends a 48px minimum touch target. */
.btn--sm { padding: 0.7rem 1rem; font-size: 0.9rem; min-height: 48px; }

.btn--danger {
  background: rgba(255, 90, 85, 0.16);
  color: #ffb4b0;
  border: 1px solid rgba(255, 90, 85, 0.42);
}
.btn--danger:hover { background: rgba(255, 90, 85, 0.28); }

/* ------------------------------ Hero ------------------------------------ */

.hero {
  position: relative;
  text-align: center;
  color: var(--ink);
  padding: 5rem 1rem 3rem;
  overflow: hidden;
}
/* The body blobs now provide the backdrop interest. */
.hero__overlay { display: none; }

/* Glass centerpiece panel. */
.hero__content {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.25rem);
  border-radius: 26px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow);
}

.hero__eyebrow {
  display: inline-block;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin: 0 0 1.1rem;
}
.hero__title {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 800;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
  line-height: 1.05;
}
.hero__tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-style: italic;
  margin: 0.75rem 0 2rem;
  opacity: 0.95;
}
.hero__order {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero__phone {
  margin-top: 1.5rem;
  font-size: 1.15rem;
}
.hero__phone strong { color: var(--accent); }

/* ---------------------------- Gallery ----------------------------------- */

.gallery-section { padding: 3.5rem 0 1rem; }

.section-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--ink);
}
.section-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 600px;
  margin: 0.5rem auto 2.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
}

.loading, .empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 2rem;
}

/* Frosted glass card (shared base). */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.flower-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.flower-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.flower-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(45, 212, 167, 0.24));
  display: flex;
  align-items: center;
  justify-content: center;
}
.flower-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flower-card__placeholder { font-size: 3.5rem; }

.badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.badge--in { background: var(--emerald-bright); }
.badge--out {
  background: var(--badge-out-bg);
  color: #cfe9df;
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.flower-card__body { padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.4rem; }
.flower-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.flower-card__name { font-size: 1.4rem; color: var(--ink); }
.flower-card__price {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-size: 1.05rem;
}
.flower-card__desc { color: var(--muted); margin: 0; }

/* ------------------------------ Footer ---------------------------------- */

.footer {
  margin-top: 3rem;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  color: var(--ink);
  padding: 2.5rem 0 1.5rem;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.footer__name { font-size: 1.6rem; color: var(--accent); }
.footer__loc { margin: 0.25rem 0 0; opacity: 0.85; }
.footer__contact { text-align: right; }
.footer__contact p { margin: 0 0 0.25rem; opacity: 0.85; }
.footer__phone {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.footer__copyright {
  text-align: center;
  margin: 2rem 0 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Discreet admin link: looks like the trailing separator dot in the copyright
   line until hovered/focused, then reveals itself. Hidden from customers in
   plain sight; staff know to click the dot. Keyboard-focusable for access. */
.footer__admin {
  color: inherit;
  text-decoration: none;
  cursor: default;
  padding: 0 0.15rem;
}
.footer__admin:hover,
.footer__admin:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  outline: none;
}

/* =========================================================================
   ADMIN PORTAL
   ========================================================================= */

.admin-body { min-height: 100vh; }

/* Dashboard layout */
.dashboard { padding-bottom: 3rem; }
.admin-header {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  color: var(--ink);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-header__title { font-size: 1.5rem; }

.admin-grid {
  width: min(1100px, 94%);
  margin: 1.75rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
}
.admin-card { padding: 1.5rem 1.5rem 1.75rem; }
.admin-card__title { font-size: 1.5rem; color: var(--ink); margin-bottom: 1.25rem; }

/* Form fields */
.field { display: block; margin-bottom: 1.1rem; }
.field__label { display: block; font-weight: 700; margin-bottom: 0.4rem; color: var(--ink); }
.field__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  /* Large, finger-friendly inputs */
  min-height: 50px;
}
.field__input::placeholder { color: rgba(234, 255, 247, 0.5); }
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 215, 115, 0.28);
}
textarea.field__input { min-height: 90px; resize: vertical; }
.field__input--file { padding: 0.65rem; }
.field__hint { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.35rem; }

/* Availability toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  width: 60px;
  height: 34px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .switch__track { background: var(--emerald-bright); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(26px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(255, 215, 115, 0.4); }
.switch__text { font-weight: 700; }

.form-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.form-status { margin: 1rem 0 0; font-weight: 700; text-align: center; }
.form-status--ok { color: #5fe0b8; }
.form-status--err { color: var(--red); }

/* Manage list */
.manage-list { display: flex; flex-direction: column; gap: 1rem; }
.manage-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.manage-item__thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(45, 212, 167, 0.24));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.manage-item__info { flex: 1 1 140px; min-width: 0; }
.manage-item__name { font-family: var(--font-head); font-size: 1.2rem; color: var(--ink); }
.manage-item__price { color: var(--muted); font-weight: 700; }
.manage-item__status { font-size: 0.85rem; font-weight: 700; }
.manage-item__status--in { color: #5fe0b8; }
.manage-item__status--out { color: var(--muted); }
.manage-item__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; width: 100%; }
.manage-item__actions .btn { flex: 1 1 auto; }

/* ---------------------------- Responsive -------------------------------- */

@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 3.5rem 0.5rem 2.5rem; }
  .hero__order { flex-direction: column; }
  .hero__order .btn { width: 100%; }
  .footer__inner { flex-direction: column; text-align: center; }
  .footer__contact { text-align: center; }
}

/* ---- Fallback: solid surfaces where backdrop-filter is unsupported ------ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero__content,
  .card,
  .footer,
  .admin-header,
  .manage-item,
  .btn--text {
    background: var(--glass-fallback);
  }
}
