/* === Global === */
:root {
  --bg-body: #020617;
  --border-soft: rgba(148, 163, 184, 0.4);
  --border-subtle: rgba(148, 163, 184, 0.25);

  /* Card + surface */
  --card-bg: radial-gradient(circle at top left, #0b1220, #020617 60%);
  --chip-bg: rgba(15, 23, 42, 0.9);
  --btn-bg: rgba(15, 23, 42, 0.85);

  /* PITP brand tokens */
  --brand-1: #033c55; /* deep teal/navy */
  --brand-2: #105d80; /* cyan-teal */
  --brand-3: #a4ddbc; /* mint */

  --radius-xl: 1.25rem;

  /* Map fill */
  --map-fill-off: rgba(255, 255, 255, 0.1);
}

html,
body {
  margin: 0;
  padding: 0;
}

/* === Page background (dark + animated PITP gradient) === */

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: #e5e7eb;
  font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  /* Large, dark animated gradient using PITP colors */
  background: radial-gradient(circle at 0% 0%, #020617 0, #020617 40%),
              radial-gradient(circle at 100% 0%, #020617 0, #020617 40%),
              radial-gradient(circle at 0% 100%, #020617 0, #020617 40%),
              radial-gradient(circle at 100% 100%, #020617 0, #020617 40%),
              linear-gradient(135deg,
                #020617 0%,
                #031824 20%,
                #033c55 40%,
                #0b2334 60%,
                #105d80 80%,
                #020617 100%);
  background-size: 220% 220%;
  background-position: 0% 0%;
  animation: pitp-surface-pan 60s ease-in-out infinite alternate;
  background-color: var(--bg-body);
}

/* Moving dark gradient (darker <-> slightly lighter) */
@keyframes pitp-surface-pan {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
  100% {
    background-position: 100% 0%;
  }
}

/* Additional soft PITP-colored glow layer */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(circle at 15% 20%, rgba(164, 221, 188, 0.18), transparent 55%), /* brand-3 mint */
    radial-gradient(circle at 85% 15%, rgba(16, 93, 128, 0.25), transparent 55%),   /* brand-2 */
    radial-gradient(circle at 20% 90%, rgba(3, 60, 85, 0.22), transparent 55%);     /* brand-1 */

  mix-blend-mode: screen;
  opacity: 0.7;
  animation: pitp-bg-orbit 38s ease-in-out infinite alternate;
}

/* Subtle vignette for depth */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, transparent 0, rgba(0, 0, 0, 0.15) 55%, rgba(0, 0, 0, 0.4) 100%);
  opacity: 0.9;
}

/* Background motion for glow layer */
@keyframes pitp-bg-orbit {
  0% {
    transform: translate3d(-3%, -4%, 0) scale(1);
    opacity: 0.6;
  }
  35% {
    transform: translate3d(3%, 1%, 0) scale(1.04);
    opacity: 0.8;
  }
  70% {
    transform: translate3d(-1%, 4%, 0) scale(1.06);
    opacity: 0.7;
  }
  100% {
    transform: translate3d(2%, 0%, 0) scale(1.02);
    opacity: 0.75;
  }
}

/* === Generic cards / chips / pills === */

.card {
  background:
    radial-gradient(circle at 0 0, rgba(164, 221, 188, 0.12), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(16, 93, 128, 0.18), transparent 55%),
    linear-gradient(to bottom right, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  box-shadow:
    0 22px 60px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
}

.chip {
  background: linear-gradient(
    135deg,
    rgba(3, 60, 85, 0.96),
    rgba(15, 23, 42, 0.96)
  );
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.pill {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: radial-gradient(circle at 0 0, rgba(164, 221, 188, 0.16), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.7rem;
}

/* Glow utility (for hero blocks / CTAs) */

.glow {
  position: relative;
}

.glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background:
    radial-gradient(600px circle at 0 0, rgba(164, 221, 188, 0.2), transparent 45%), /* brand-3 */
    radial-gradient(600px circle at 100% 0, rgba(16, 93, 128, 0.18), transparent 45%); /* brand-2 */
  filter: blur(14px);
}

/* === Buttons === */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-soft);
  background: var(--btn-bg);
  font-size: 0.85rem;
  font-weight: 500;
  color: #e5e7eb;
  text-decoration: none;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}

/* Default button hover – for non-primary buttons */
.btn:hover {
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}

/* Primary button – PITP gradient, always light text */
.btn-primary {
  background: linear-gradient(
    135deg,
    #0f172a,
    #033c55,
    #105d80
  );
  border-color: rgba(148, 163, 184, 0.4);
  color: #f9fafb; /* light text, fixes contrast issue */
  font-weight: 600;
}

/* Override hover for primary so it never turns solid dark */
.btn-primary:hover {
  background: linear-gradient(
    135deg,
    #111827,
    #06476a,
    #1a6f96
  );
  border-color: rgba(164, 221, 188, 0.7);
  color: #f9fafb;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.98),
    0 0 0 1px rgba(15, 23, 42, 0.95);
  transform: translateY(-1px);
  filter: none; /* prevent over-brightening artifacts */
}

/* Ghost button */
.btn-ghost {
  background: rgba(15, 23, 42, 0.3);
  border-color: var(--border-subtle);
  color: #e5e7eb;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.85);
}

/* === Tables === */

.tbl {
  border-collapse: collapse;
  width: 100%;
}

.tbl th,
.tbl td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.tbl th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tbl td {
  font-size: 0.82rem;
}

/* === Modal backdrop === */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(16, 93, 128, 0.45),
    rgba(15, 23, 42, 0.92)
  );
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 40;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal container */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
}

.modal.open {
  display: flex;
}

/* === Map wrappers & SVG === */

#mapA-wrap,
#mapB-wrap {
  background: radial-gradient(circle at 20% 0%, #1f2937 0, #020617 60%);
}

#mapA-wrap svg,
#mapB-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

#mapA-tooltip,
#mapB-tooltip {
  color: #e5e7eb;
  white-space: nowrap;
}

/* Sindh maps root styling */
#sindh-maps svg {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(135deg, #033c55, #0b1220); /* brand-1 + deep navy */
}

#sindh-maps .hit {
  outline: none;
}

#sindh-maps .pill {
  border-radius: 999px;
}

/* Leaflet core tweaks */

.leaflet-container {
  background: #020617;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(11, 22, 43, 0.95);
  color: #e5fff6;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Leaflet pin override */
.pitp-pin {
  transform: translate(-7px, -7px);
}

.pitp-pin span {
  display: inline-block;
}

/* === Gallery lightbox === */

.lightbox {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(15, 23, 42, 0.98),
    rgba(2, 6, 23, 0.98)
  );
  display: grid;
  place-items: center;
  z-index: 999;
}

.lightbox img {
  max-width: min(90vw, 1000px);
  max-height: 90vh;
  border-radius: 1rem;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.95);
}

/* === Small utilities === */

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Gallery grid */

#photo-grid a {
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: block;
}

#photo-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* WhatsApp floating button */

.wh-follow {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 60;
}

/* Day selector in Gallery */

#sel-day {
  background: #0c1a30;
  color: #fff;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

#sel-day:focus {
  outline: 2px solid rgba(16, 185, 129, 0.6);
  outline-offset: 2px;
}

#sel-day option {
  background: #0c1a30;
  color: #fff;
}

/* Make details/summary nicer on dark */

details {
  border-radius: 0.9rem;
}

details summary::-webkit-details-marker {
  display: none;
}

/* Accessible focus rings */

:where(a, button, summary, select) {
  outline-offset: 3px;
}

:where(a, button, summary, select):focus-visible {
  outline: 2px solid var(--brand-3);
}
