/* ============================================================
   GabayPH — Futuristic + Elderly-Friendly Stylesheet
   Custom layer on top of Tailwind CDN utilities.
   ============================================================ */

:root {
  --gp-blue: #0038a8;
  --gp-red: #ce1126;
  --gp-gold: #fcd116;
  --gp-cyan: #22d3ee;
  --gp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Elderly-friendly global text scaling (rem-based, so every
       Tailwind utility scales with it). Toggled by header buttons. ---- */
html { font-size: 100%; scroll-behavior: smooth; }
html.font-large  { font-size: 112.5%; }
html.font-xlarge { font-size: 128%; }

body {
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

/* ---- Animated aurora / mesh background (futuristic depth) ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(45rem 45rem at 12% 8%, rgba(0, 56, 168, 0.16), transparent 60%),
    radial-gradient(40rem 40rem at 88% 18%, rgba(252, 209, 22, 0.12), transparent 60%),
    radial-gradient(48rem 48rem at 50% 110%, rgba(206, 17, 38, 0.10), transparent 60%),
    radial-gradient(38rem 38rem at 78% 82%, rgba(34, 211, 238, 0.12), transparent 60%);
  animation: gpAuroraDrift 24s var(--gp-ease) infinite alternate;
}
.dark body::before {
  background:
    radial-gradient(45rem 45rem at 12% 8%, rgba(0, 56, 168, 0.30), transparent 60%),
    radial-gradient(40rem 40rem at 88% 18%, rgba(252, 209, 22, 0.14), transparent 60%),
    radial-gradient(48rem 48rem at 50% 110%, rgba(206, 17, 38, 0.18), transparent 60%),
    radial-gradient(38rem 38rem at 78% 82%, rgba(34, 211, 238, 0.16), transparent 60%);
}
@keyframes gpAuroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.03); }
}

/* Subtle moving grid overlay for a "tech" feel */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(0, 56, 168, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 56, 168, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}
.dark body::after {
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.07) 1px, transparent 1px);
}

/* ---- Glassmorphism cards ---- */
.glassmorphism {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 32px rgba(2, 20, 60, 0.08);
}
.dark .glassmorphism {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Glowing hover lift for interactive cards */
.gp-lift {
  transition: transform 0.35s var(--gp-ease), box-shadow 0.35s var(--gp-ease), border-color 0.35s ease;
}
.gp-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(0, 56, 168, 0.18);
  border-color: rgba(0, 56, 168, 0.35);
}
.dark .gp-lift:hover {
  box-shadow: 0 16px 44px rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.35);
}

/* Animated gradient headline */
.gp-gradient-text {
  background: linear-gradient(90deg, var(--gp-blue), var(--gp-red), var(--gp-gold), var(--gp-blue));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gpGradientSlide 8s linear infinite;
}
@keyframes gpGradientSlide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---- Elderly-friendly: big, obvious focus rings everywhere ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gp-gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Larger, comfortable tap targets */
button, a.gp-tap { min-height: 44px; }

/* ---- Text-size control (A / A+ / A++) ---- */
.font-scale-btn {
  transition: all 0.2s ease;
}
.font-scale-btn.is-active {
  background: var(--gp-blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 56, 168, 0.4);
}

/* ---- Scroll-reveal (futuristic entrance) ---- */
.gp-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--gp-ease), transform 0.7s var(--gp-ease);
}
.gp-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Live-status pulsing dot */
.gp-live-dot {
  position: relative;
}
.gp-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: currentColor;
  animation: gpPing 1.6s var(--gp-ease) infinite;
}
@keyframes gpPing {
  0%   { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Weather icon gentle float */
.gp-float { animation: gpFloat 5s ease-in-out infinite; }
@keyframes gpFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Loading shimmer for live-data placeholders */
.gp-shimmer {
  background: linear-gradient(90deg, rgba(148,163,184,0.15) 25%, rgba(148,163,184,0.35) 37%, rgba(148,163,184,0.15) 63%);
  background-size: 400% 100%;
  animation: gpShimmer 1.4s ease infinite;
  border-radius: 6px;
  color: transparent !important;
}
@keyframes gpShimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gp-blue), var(--gp-cyan));
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gp-blue); }

/* ---- Reduced motion: kill all animation for sensitive users ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .gp-reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Region dropdown + per-region panels (weather / flood /
   utilities / jobs)
   ============================================================ */

/* Native select styled to match the futuristic theme */
.gp-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230038a8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}
.dark .gp-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fcd116'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

/* Flood / river warning badge levels */
.gp-flood { display: inline-flex; align-items: center; gap: 0.4rem; }
.flood-low      { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flood-moderate { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.flood-high     { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.flood-severe   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.dark .flood-low      { background: rgba(22,101,52,0.35);  color: #86efac; border-color: rgba(134,239,172,0.4); }
.dark .flood-moderate { background: rgba(133,77,14,0.35);  color: #fde047; border-color: rgba(253,224,71,0.4); }
.dark .flood-high     { background: rgba(154,52,18,0.35);  color: #fdba74; border-color: rgba(253,186,116,0.4); }
.dark .flood-severe   { background: rgba(153,27,27,0.4);   color: #fca5a5; border-color: rgba(252,165,165,0.4); }

/* Placeholder "not set yet" pill for editable data.json fields */
.gp-unset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  font-style: italic;
  color: #94a3b8;
  background: rgba(148,163,184,0.12);
  border: 1px dashed rgba(148,163,184,0.5);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

/* Provider row (label / value) used in utilities panel */
.gp-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(100,116,139,0.15);
}
.gp-row:last-child { border-bottom: 0; padding-bottom: 0; }
.gp-row > span:first-child { flex: 0 0 auto; padding-top: 0.1rem; }
.gp-row > span:last-child {
  text-align: right;
  max-width: 66%;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

/* Job / sector chips */
.gp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(0,56,168,0.08);
  color: var(--gp-blue);
  border: 1px solid rgba(0,56,168,0.2);
}
.dark .gp-chip {
  background: rgba(34,211,238,0.1);
  color: #67e8f9;
  border-color: rgba(34,211,238,0.25);
}

/* Quick-link hub tiles on the home page */
.gp-tile {
  transition: transform 0.3s var(--gp-ease), box-shadow 0.3s var(--gp-ease);
}
.gp-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(0,56,168,0.18);
}

/* ============================================================
   Daily utility monitoring: freshness badges, rate notes and
   one-tap provider actions (call / payment / advisory link)
   ============================================================ */

/* "Auto-checked today" badge — only shown when the daily job really ran */
.gp-status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.dark .gp-status-live {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
}

/* "Curated / check unavailable" badge — never pretend stale data is live */
.gp-status-curated {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a3412;
  background: rgba(251, 146, 60, 0.14);
  border: 1px solid rgba(251, 146, 60, 0.35);
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
}
.dark .gp-status-curated {
  color: #fdba74;
  background: rgba(251, 146, 60, 0.18);
  border-color: rgba(251, 146, 60, 0.45);
}

/* As-of line under an indicative rate */
.gp-rate-asof {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 0.1rem;
}

/* Provider caveat / coverage note */
.gp-note {
  font-size: 11px;
  line-height: 1.55;
  color: #64748b;
  margin-top: 0.65rem;
}
.dark .gp-note { color: #94a3b8; }

/* One-tap provider actions */
.gp-util-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.gp-mini-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gp-blue);
  background: rgba(0, 56, 168, 0.08);
  border: 1px solid rgba(0, 56, 168, 0.2);
  transition: all 0.2s ease;
}
.gp-mini-link:hover { background: rgba(0, 56, 168, 0.16); }
.dark .gp-mini-link {
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.25);
}
.dark .gp-mini-link:hover { background: rgba(34, 211, 238, 0.2); }
.gp-mini-link.is-call {
  color: #fff;
  background: var(--gp-red);
  border-color: var(--gp-red);
}
.gp-mini-link.is-call:hover { background: #a80b1c; }
.gp-mini-link.is-pay {
  color: #065f46;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}
.gp-mini-link.is-pay:hover { background: rgba(16, 185, 129, 0.24); }
.dark .gp-mini-link.is-pay {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Coverage strip listing every provider GabayPH tracks */
.gp-coverage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.gp-coverage-cell {
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: rgba(148, 163, 184, 0.06);
}
.dark .gp-coverage-cell {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
}
.gp-coverage-cell h5 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.dark .gp-coverage-cell h5 { color: #94a3b8; }
.gp-coverage-cell p {
  font-size: 11px;
  line-height: 1.5;
  color: #334155;
}
.dark .gp-coverage-cell p { color: #cbd5e1; }
