﻿/* ==========================================================================
   Rogue Fly Fish — site.css
   - Minimal base styles that play nice with Tailwind
   - Compact, scrollable top nav for phones
   - Reusable “glass” cards, buttons, forms, toasts, lightbox
   ========================================================================== */

/* ---- CSS variables (colors & radii) ------------------------------------ */
:root {
  --bg: #0b1a29;                  /* page background */
  --panel: rgba(17, 34, 51, 0.85);/* glass card bg */
  --panel-border: rgba(255,255,255,.06);
  --text: #e8efff;                /* primary text */
  --muted: #9fb4cc;               /* secondary text */
  --brand: #10b981;               /* emerald accent */
  --brand-weak: rgba(16,185,129,.22);
  --chip-bg: rgba(255,255,255,.05);
  --chip-br: rgba(255,255,255,.16);
  --chip-bg-hover: rgba(255,255,255,.10);
  --radius-xl: 18px;
  --radius-2xl: 22px;

  --focus: 0 0 0 3px rgba(16,185,129,.35);
}

/* ---- Base --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 800px at 20% -10%, #0f2236, transparent),
              radial-gradient(900px 600px at 120% 0%, #0d2742, transparent),
              var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

/* ---- Layout helpers ----------------------------------------------------- */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* Hide scrollbars when desired */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Header & Top Nav --------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(7,17,28,.95), rgba(7,17,28,.75));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}

/* Compact, single-line, scrollable top nav */
.rff-topnav {
  display: flex !important;
  align-items: center !important;
  gap: .5rem !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  padding: .5rem .25rem !important;
  -webkit-text-size-adjust: 100%;
}
.rff-topnav::-webkit-scrollbar { display: none; }

.rff-topnav .nav-link {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  font-size: clamp(13px, 3.6vw, 15px) !important;
  padding: .38rem .62rem !important;
  border-radius: 999px !important;
  border: 1px solid var(--chip-br) !important;
  background: var(--chip-bg) !important;
  color: var(--text) !important;
  text-decoration: none !important;
}
.rff-topnav .nav-link:hover,
.rff-topnav .nav-link:focus-visible { background: var(--chip-bg-hover) !important; }
.rff-topnav .nav-link[aria-current="page"] {
  background: var(--brand-weak) !important;
  border-color: rgba(16,185,129,.45) !important;
  color: #fff !important;
}

/* Optional edge fades — set to display:block; to enable */
.rff-topnav-wrap { position: relative; }
.rff-topnav-wrap::before,
.rff-topnav-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none;
  display: none;
}
.rff-topnav-wrap::before { left: 0; background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(0,0,0,0)); }
.rff-topnav-wrap::after  { right: 0; background: linear-gradient(270deg, rgba(0,0,0,.25), rgba(0,0,0,0)); }

@media (max-width: 380px) {
  .rff-topnav { gap: .35rem !important; }
  .rff-topnav .nav-link { padding: .30rem .50rem !important; font-size: 13px !important; }
}

/* ---- Cards (“glass”) ---------------------------------------------------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 10px 30px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.04);
}

.panel { padding: 1rem; border-radius: var(--radius-xl); background: var(--panel); border: 1px solid var(--panel-border); }
.panel h2, .panel h3 { margin: 0 0 .5rem 0; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: .62rem 1rem; border-radius: 12px;
  color: #081521; background: #dbeafe; font-weight: 600;
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); }

.btn-emerald { background: #10b981; color: #02100c; }
.btn-sky     { background: #38bdf8; color: #001018; }
.btn-red     { background: #ef4444; color: #170404; }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--chip-br);
}

/* Small chips */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .55rem; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--chip-br); color: var(--muted);
  font-size: .85rem; line-height: 1;
}

/* ---- Forms -------------------------------------------------------------- */
.input, .select, .textarea {
  width: 100%; color: var(--text); background: rgba(8,16,28,.6);
  border: 1px solid var(--panel-border); border-radius: 12px;
  padding: .7rem .8rem; outline: none;
}
.input::placeholder, .textarea::placeholder { color: #9fb4cc; opacity: .7; }
.textarea { min-height: 120px; resize: vertical; }

.input:focus, .select:focus, .textarea:focus { box-shadow: var(--focus); }

/* File input preview image */
#photo-preview, .rff-log-photo {
  border-radius: 12px; border: 1px solid var(--panel-border);
}

/* Inline help text */
.help { color: var(--muted); font-size: .9rem; }

/* ---- Toast (id="log-toast") -------------------------------------------- */
#log-toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: .6rem .9rem; border-radius: 12px; color: #041016;
  background: #34d399; transition: opacity .25s ease; opacity: 0; z-index: 9999;
  box-shadow: 0 10px 18px rgba(0,0,0,.4);
}
#log-toast.bg-red-500 { background: #f87171; color: #1b0b0b; }
#log-toast.bg-emerald-500 { background: #34d399; color: #051711; }

/* ---- Lightbox dialog (id="rff-lightbox") ------------------------------- */
dialog#rff-lightbox {
  border: 0; padding: 0; background: transparent;
}
dialog#rff-lightbox::backdrop {
  background: rgba(0,0,0,.75);
}
#rff-lightbox-img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 14px; border: 1px solid var(--panel-border);
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
}

/* ---- Tables (Counts page) ---------------------------------------------- */
.table {
  width: 100%; border-collapse: collapse; color: var(--text);
}
.table th, .table td {
  padding: .6rem .7rem; border-bottom: 1px solid var(--panel-border);
  text-align: left;
}
.table thead th {
  color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .85rem;
}

/* ---- Utilities ---------------------------------------------------------- */
.text-muted { color: var(--muted); }
.badge { padding: .2rem .5rem; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid var(--panel-border); }

/* Make <details> prettier */
details {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px; padding: .6rem .8rem;
}
details[open] { background: rgba(255,255,255,.05); }

/* ---- Footer ------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  padding: 1.2rem 0; margin-top: 2rem;
  background: linear-gradient(0deg, rgba(7,17,28,.75), rgba(7,17,28,.35));
}

/* ---- Safe area for iOS -------------------------------------------------- */
:root {
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}
.header { padding-top: calc(6px + var(--safe-top)); }
body { padding-bottom: var(--safe-bottom); }

/* ---- Print helpers (simple) -------------------------------------------- */
@media print {
  .header, .footer, .rff-topnav-wrap, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .glass, .panel { background: #fff; border: 1px solid #ddd; box-shadow: none; }
}
/* Make the nav container shrinkable inside a flex header */
.rff-topnav-wrap {
  flex: 1 1 auto;     /* take remaining space but allow shrinking */
  min-width: 0;       /* CRITICAL: allow inner overflow-x to work */
}

/* Prevent parent clipping; add iPhone safe-area padding on the right */
.header {
  overflow: visible;  /* ensure we don't clip the scrollable nav */
}

/* Give the scrolling row a bit of right padding for the swipe and notch */
.rff-topnav {
  padding-right: calc(10px + env(safe-area-inset-right));
  scroll-padding-right: 24px;
}
/* Brand logo in header */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: clamp(28px, 6.2vh, 44px);   /* fluid: phones → desktops */
  width: auto;                        /* keep aspect ratio */
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

/* Give the nav room next to the logo on tight screens */
.header .container {
  display: flex;
  align-items: center;
  gap: .75rem;
}
/* Header structure */
.header { position: sticky; top: 0; z-index: 70; }

/* Red support bar inside header (no fixed positioning) */
.support-bar {
  display: block;
  padding: .4rem .5rem;
  text-align: center;
  font: 600 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  letter-spacing: .06em;
  color: #fff;
  background: rgba(225,29,72,.92); /* rose-600/90 */
  text-decoration: none;
}

/* Header row = brand + scrollable nav */
.header-row { display: flex; align-items: center; gap: .75rem; }

/* Make the nav row scrollable and reachable on iPhone */
.rff-topnav-wrap { flex: 1 1 auto; min-width: 0; }
.rff-topnav { padding-right: calc(10px + env(safe-area-inset-right)); }

/* Brand sizing */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: clamp(28px, 6.2vh, 44px); width: auto; object-fit: contain; -webkit-user-drag: none; }

/* Hide hamburger by default */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.7rem;
  color: white;
  cursor: pointer;
}

/* Desktop dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: rgba(25,25,25,0.95);
  border-radius: 8px;
  top: 100%;
  left: 0;
  min-width: 180px;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 8px 12px;
  color: white;
  text-decoration: none;
}

.dropdown-content a:hover {
  background: rgba(255,255,255,0.1);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Mobile menu */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: rgba(15,15,15,0.96);
  position: absolute;
  top: 48px;
  right: 0;
  width: 220px;
  border-radius: 8px;
  z-index: 9999;
  padding: 8px 0;
}

.mobile-nav a,
.mobile-nav summary {
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  display: block;
}

.mobile-nav summary {
  cursor: pointer;
  font-weight: 600;
}

.mobile-nav details[open] a {
  padding-left: 26px;
}

.mobile-nav.show {
  display: flex;
}

/* Hide desktop links on mobile */
@media (max-width: 820px) {
  .hamburger {
    display: block;
  }
  .desktop-links {
    display: none;
  }
}

/* Add space between header links */
.desktop-links a {
  margin: 0 0.75rem;        /* horizontal spacing */
  padding: 0.25rem 0;       /* vertical balance */
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.desktop-links a:hover {
  color: #ffb347;            /* subtle warm highlight */
  text-decoration: underline; /* optional, feels more like a link */
}

/* Optional: adjust dropdown spacing to match */
.dropdown-content a {
  margin: 0;
  padding: 8px 14px;
}

/* ===== Header / Tagline (final) ===== */

/* Row layout */
.header-row {
  display: flex;
  align-items: center;
  gap: .85rem;                /* balanced spacing */
}

/* Neon tagline */
.tagline {
  display: inline-block;      /* ensure it renders everywhere */
  flex: 0 1 auto;             /* allow shrinking with ellipsis */
  min-width: 0;
  margin-left: 0.75rem;
  white-space: nowrap;
  letter-spacing: 0.6px;

  font-size: 1.05rem;
  font-weight: 700;
  /* UPDATED: Use the theme variable for color */
  color: var(--tagline, #39ff90);
  text-shadow: 0 0 8px color-mix(in srgb, var(--tagline, #39ff90) 45%, transparent);
}


/* Keep hamburger pinned right */
.hamburger {
  margin-left: auto;
}
/* ... rest of the file ... */

/* Mobile adjustments */
@media (max-width: 420px) {
  .tagline { max-width: 56vw; }
}

    font-size: .98rem;
    max-width: 60vw;          /* don’t crowd the hamburger */
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.hamburger[hidden] { display: none !important; }

/* --- Theme-specific Overrides --- */

/* Add turkey and leaves to the tagline when the theme is active */
body.theme-autumn-harvest .tagline::before {
    content: '🦃 '; /* Turkey emoji before the text */
    margin-right: 0.25rem;
}

body.theme-autumn-harvest .tagline::after {
    content: ' 🍂'; /* Falling leaf emoji after the text */
    margin-left: 0.25rem;
}

/* --- THEME-SPECIFIC VISUAL HOOKS --- */

/* Targets the Autumn Harvest theme via body class and adds emojis to the tagline */
body.theme-autumn-harvest .tagline::before {
    content: '🦃 '; /* Turkey emoji before the text */
    margin-right: 0.25rem;
}

body.theme-autumn-harvest .tagline::after {
    content: ' 🍂'; /* Falling leaf emoji after the text */
    margin-left: 0.25rem;
}

/* Example: Add a tiny, subtle leaf image to the background (optional) */
/* This requires a separate image file (e.g., leaf.svg) */
/*
body.theme-autumn-harvest {
    background-image: url('/img/leaf.svg'), linear-gradient(...);
    background-repeat: repeat;
    background-size: 80px 80px;
    opacity: 0.2;
}
*/