/*
 * MATCHLATCH-V1.1-GREENGLASS-100926
 * Forest-green Liquid Glass-inspired five-tab navigation.
 * Purposefully loaded after the base shell and light/dark theme styles.
 * Frost, depth and active states are CSS-only; no changes to navigation logic.
 */
:root {
  --ml-glass-green: 48, 60, 49; /* Existing deep forest green from dark-mode surfaces. */
  --ml-glass-text: #f7fbf6;
  --ml-glass-rim: rgba(248, 255, 248, .44);
  --ml-glass-shadow: rgba(16, 28, 18, .32);
}

/* Frosted translucent material with layered specular highlights. */
.bottom-nav {
  width: min(550px, calc(100% - 30px));
  bottom: 16px;
  border-radius: 29px;
  border: 1px solid var(--ml-glass-rim);
  background:
    linear-gradient(158deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.025) 37%, rgba(5,21,9,.10) 100%),
    rgba(var(--ml-glass-green), .77);
  -webkit-backdrop-filter: blur(28px) saturate(155%) contrast(112%);
  backdrop-filter: blur(28px) saturate(155%) contrast(112%);
  box-shadow:
    0 18px 46px var(--ml-glass-shadow),
    0 4px 12px rgba(14,29,17,.16),
    inset 0 1px 0 rgba(255,255,255,.34),
    inset 0 -1px 0 rgba(7,21,10,.20);
  overflow: hidden;
  isolation: isolate;
}

/* Directional reflection: looks like light falling across a curved glass edge. */
.bottom-nav::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 92% 120% at 12% -42%, rgba(255,255,255,.22), transparent 69%),
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 30%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26);
  z-index: 0;
}

.bottom-nav::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.68) 48%, transparent);
  opacity: .83;
  z-index: 0;
}

.bottom-nav-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 3px;
  align-items: center;
  padding: 8px;
}

/* Keep all five destinations readable against the shifting page backdrop. */
.bottom-nav .dock-link {
  min-width: 0;
  min-height: 58px;
  color: rgba(248,253,248,.88);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 19px;
  letter-spacing: .065em;
  text-shadow: 0 1px 2px rgba(11,23,12,.22);
  -webkit-tap-highlight-color: transparent;
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease, color .22s ease, transform .22s ease;
}

.bottom-nav .dock-link:hover {
  color: var(--ml-glass-text);
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.13);
}

.bottom-nav .dock-link.active,
.bottom-nav .dock-link[aria-current="page"] {
  color: #fff;
  border-color: rgba(255,255,255,.29);
  background: linear-gradient(160deg, rgba(255,255,255,.23), rgba(255,255,255,.07) 75%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    0 2px 9px rgba(8,25,12,.13);
}

.bottom-nav .dock-link:active {
  transform: scale(.97);
}

.bottom-nav .dock-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* Studio remains central; its symbol is a smaller glass inset, not a solid chip. */
.bottom-nav .dock-studio-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,.23), rgba(255,255,255,.065));
  border: 1px solid rgba(255,255,255,.38);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.29),
    0 3px 10px rgba(10,26,14,.22);
  transform: translateY(-2px);
}

.bottom-nav .dock-studio:hover .dock-studio-icon,
.bottom-nav .dock-studio.active .dock-studio-icon {
  color: #fff;
  background: linear-gradient(155deg, rgba(255,255,255,.31), rgba(255,255,255,.11));
  border-color: rgba(255,255,255,.47);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 4px 12px rgba(7,19,10,.25);
}

/* Same brand green in dark mode, with subdued reflections and stronger depth. */
:root[data-theme="dark"] .bottom-nav {
  border-color: rgba(226,244,227,.32);
  background:
    linear-gradient(158deg, rgba(255,255,255,.11), rgba(255,255,255,.025) 39%, rgba(0,10,2,.12)),
    rgba(var(--ml-glass-green), .79);
  box-shadow:
    0 18px 48px rgba(0,0,0,.55),
    0 4px 12px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(245,255,246,.28),
    inset 0 -1px 0 rgba(0,9,2,.30);
}
:root[data-theme="dark"] .bottom-nav .dock-link {
  color: rgba(240,248,240,.88);
}
:root[data-theme="dark"] .bottom-nav .dock-link:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
:root[data-theme="dark"] .bottom-nav .dock-link.active,
:root[data-theme="dark"] .bottom-nav .dock-link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(165deg, rgba(248,255,249,.19), rgba(248,255,249,.065));
  border-color: rgba(244,255,244,.30);
}
:root[data-theme="dark"] .bottom-nav .dock-studio-icon,
:root[data-theme="dark"] .bottom-nav .dock-studio:hover .dock-studio-icon,
:root[data-theme="dark"] .bottom-nav .dock-studio.active .dock-studio-icon {
  color: #fff;
  border-color: rgba(245,255,246,.38);
  background: linear-gradient(145deg, rgba(255,255,255,.20), rgba(255,255,255,.06));
}

/* Floating above the iPhone home indicator, without clipping the glass edge. */
@media (max-width: 500px) {
  .bottom-nav {
    width: calc(100% - 18px);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border: 1px solid var(--ml-glass-rim);
    border-radius: 26px;
  }
  .bottom-nav-inner {
    gap: 2px;
    padding: 7px 5px;
  }
  .bottom-nav .dock-link {
    min-height: 62px;
    border-radius: 17px;
    gap: 5px;
    font-size: 8px;
    letter-spacing: .025em;
  }
  .bottom-nav .dock-studio-icon {
    width: 39px;
    height: 39px;
    border-radius: 14px;
  }
  body {
    padding-bottom: calc(var(--dock-height) + 26px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 350px) {
  .bottom-nav { width: calc(100% - 12px); }
  .bottom-nav-inner { gap: 1px; padding: 6px 3px; }
  .bottom-nav .dock-link { font-size: 7.7px; letter-spacing: 0; }
}

/* Accessible, solid fallback when frost is disabled or not supported. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .bottom-nav,
  :root[data-theme="dark"] .bottom-nav {
    background: rgb(var(--ml-glass-green));
  }
}
@media (prefers-reduced-transparency: reduce) {
  .bottom-nav,
  :root[data-theme="dark"] .bottom-nav {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgb(var(--ml-glass-green));
  }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-nav .dock-link,
  .bottom-nav .dock-studio-icon {
    transition: none;
  }
}
