/* ====== Base Theme (match maps + weather) ====== */
:root {
  --bg: #050816;
  --bg-elevated: #060b1a;
  --glass: rgba(15, 23, 42, 0.88);
  --border-subtle: rgba(148, 163, 184, 0.25);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.18);
  --accent-strong: #0ea5e9;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.85);
  --transition-fast: 160ms ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #0b1120 0, #020617 45%, #000 100%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
}

/* ====== Sidebar / Menu (same as maps) ====== */

/* Perfect hamburger like weather page */
.menu-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  z-index: 50;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(100, 116, 139, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  transition: background 0.2s ease, transform 0.15s ease;
}

.menu-btn:hover {
  background: rgba(51, 65, 85, 0.9);
}

.menu-btn div {
  width: 26px;
  height: 3px;
  border-radius: 6px;
  background: #f1f5f9;
  transition: 0.25s ease;
}

/* Animation when menu is open */
.menu-btn.open div:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.open div:nth-child(2) {
  opacity: 0;
}

.menu-btn.open div:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


.menu {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  padding: 20px 18px;
  background: radial-gradient(circle at top, #020617 0, #020617 30%, #000 100%);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 24px 0 60px rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(22px);
  transition: left 260ms ease-out;
  z-index: 40;
}

.menu.open {
  left: 0;
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  margin-bottom: 16px;
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e0f2fe 0, #38bdf8 45%, #0ea5e9 100%);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
}

.logo-text {
  font-weight: 650;
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.menu a {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 9px 8px;
  border-radius: 10px;
  margin-top: 4px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.menu a:hover {
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  transform: translateX(2px);
}

.menu a.active-link {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18), transparent);
  color: #f9fafb;
}

.user-welcome {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.user-name {
  color: #e5e7eb;
  font-weight: 600;
}

.auth-link {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.88rem;
  color: var(--accent);
}

/* ====== Layout ====== */

.page-shell {
  min-height: 100vh;
  padding: clamp(20px, 4vw, 32px);
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  margin-top: 40px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f9fafb;
}

.subtitle {
  max-width: 620px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
}

.page-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}


/* ====== Cards ====== */

.glass-card {
  background: linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.92),
      rgba(15, 23, 42, 0.85)
    );
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px 18px;
  backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.55), transparent 55%)
    border-box;
  opacity: 0.07;
  pointer-events: none;
}

.card-title {
  font-size: 1.05rem;
  margin: 0;
  color: #f9fafb;
}

.card-subtitle {
  margin: 4px 0 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ====== Input layout ====== */

.map-section .glass-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.input-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.time-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Inputs */

.form-control {
  position: relative;
  flex: 1 1 auto;
}

.input {
  color: #f9fafb;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  background-color: transparent;
  width: 100%;
  padding: 0.6em 0.6em;
  border: none;
  border-bottom: 2px solid rgba(75, 85, 99, 0.8);
}

.input-alt {
  font-size: 0.95rem;
  padding-inline: 0.9em;
  padding-block: 0.7em;
  border-radius: 10px 10px 0 0;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.65);
}

.input-border {
  position: absolute;
  background: linear-gradient(90deg, #38bdf8, #6366f1, #ec4899);
  width: 0%;
  height: 2px;
  bottom: 0;
  left: 0;
  transition: width 240ms cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

.input:focus {
  outline: none;
}

.input:focus + .input-border {
  width: 100%;
}

.mode-select {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
}

.mode-select:focus {
  border-color: var(--accent);
}

/* Clear button */

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background-color: #020617;
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.icon-button:hover {
  background: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.65);
}

.svgIcon {
  width: 14px;
}

.svgIcon path {
  fill: #e5e7eb;
}

/* Buttons */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-btn,
.secondary-btn {
  font-family: inherit;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  padding: clamp(0.45em, 1.5vw, 0.7em) clamp(1em, 3vw, 1.2em);
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.45);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(56, 189, 248, 0.6);
}

.secondary-btn {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.45);
}

.secondary-btn:hover {
  border-color: var(--accent);
  color: #e0f2fe;
}

/* Map canvas */

.map-canvas {
  width: 100%;
  height: clamp(260px, 45vh, 420px);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(30, 64, 175, 0.7);
}

/* Right side: Popular result */

.info-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popular-content {
  margin-top: 8px;
  font-size: 0.9rem;
}

.popular-content br {
  line-height: 1.2;
}

/* Notice */

.notice-card {
  padding: 12px 13px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.notice-card h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.notice-card ul {
  padding-left: 18px;
  margin: 0;
}

.notice-card li + li {
  margin-top: 4px;
}

/* ====== Responsive ====== */

@media (max-width: 720px) {
  .page-shell {
    padding: 78px 14px 24px;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row {
    margin-top: 2px;
  }

  .map-canvas {
    height: 340px;
  }
}



/* Popular Time Cards */
.pt-card {
  background: #1d1d1d;
  padding: 20px;
  border-radius: 18px;
  margin-top: 20px;
  border: 1px solid #333;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  animation: fadeInUp 0.5s ease;
}

.pt-card h3 {
  margin-bottom: 10px;
  color: #4db8ff;
}

/* Busyness Bar */
.pt-busy-bar {
  width: 100%;
  height: 14px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pt-busy-fill {
  height: 14px;
  width: 80%;
  transition: width .4s ease;
}

/* Color rules based on intensity */
.pt-busy-fill.quiet { background: #2ecc71; width: 25%; }
.pt-busy-fill.moderate { background: #3498db; width: 50%; }
.pt-busy-fill.busy { background: #f39c12; width: 75%; }
.pt-busy-fill.peak,
.pt-busy-fill.surge { background: #e74c3c; width: 100%; }

/* Grid for hour status */
.pt-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

/* Fade animation */
@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}




/* === Popular Time dashboard layout === */

#popularTime {
  margin-top: 24px;
}

/* Layout structure */
.pt-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pt-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Generic card */
.pt-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.pt-card-primary {
  padding: 20px 24px;
}

.pt-card-secondary {
  padding: 16px 18px;
}

/* Card states (colors) */
.pt-card-quiet {
  border-color: #22c55e66;
  box-shadow: 0 0 25px #22c55e33;
}

.pt-card-moderate {
  border-color: #3b82f666;
  box-shadow: 0 0 25px #3b82f633;
}

.pt-card-busy {
  border-color: #f9731666;
  box-shadow: 0 0 25px #f9731633;
}

.pt-card-peak {
  border-color: #ef444466;
  box-shadow: 0 0 25px #ef444433;
}

.pt-card-closed {
  border-color: #6b728066;
  box-shadow: 0 0 25px #6b728033;
}

.pt-card-error h3 {
  margin-top: 0;
}

.pt-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 8px;
}

/* Header row */
.pt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 10px;
}

.pt-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pt-header-right {
  text-align: right;
}

.pt-badge {
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at 0 0, rgba(96, 165, 250, 0.35), transparent 55%);
  color: #e5e7eb;
}

.pt-place {
  font-size: 0.9rem;
  color: #cbd5f5;
}

.pt-percent {
  font-weight: 600;
  font-size: 1.2rem;
  color: #f9fafb;
}

/* Summary text (Hybrid C) */
.pt-summary-main {
  margin: 12px 0 4px;
  font-weight: 500;
  color: #e5e7eb;
}

.pt-summary-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Cards grid */
.pt-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}


.pt-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #e5e7eb;
}

/* Bullet list */
.pt-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pt-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: #cbd5f5;
  padding: 2px 0;
}

.pt-list li span:first-child {
  width: 20px;
  flex-shrink: 0;
}

/* Circular gauge */
.pt-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
}

.pt-gauge-outer {
  position: relative;
  width: 170px;
  height: 90px;
  border-radius: 170px 170px 0 0;
  border: 8px solid rgba(31, 41, 55, 0.95);
  border-bottom: none;
  background:
    radial-gradient(circle at 50% 100%, #020617 0, #020617 55%, transparent 56%),
    conic-gradient(
      from 180deg,
      #22c55e 0deg,
      #22c55e 36deg,
      #3b82f6 72deg,
      #f97316 126deg,
      #ef4444 180deg
    );
  overflow: hidden;
}

.pt-gauge-inner {
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 100%, #020617 0, #020617 65%, transparent 66%);
}

.pt-gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 68%;
  background: #e5e7eb;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(var(--pt-gauge-rotation, -90deg));
  box-shadow: 0 0 8px rgba(248, 250, 252, 0.9);
}

.pt-gauge-center {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 16px;
  height: 16px;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: #020617;
  border: 3px solid #e5e7eb;
}

.pt-gauge-scale {
  display: flex;
  justify-content: space-between;
  width: clamp(130px, 40vw, 170px);
  font-size: clamp(0.6rem, 1.8vw, 0.75rem);
  color: #9ca3af;
  margin-top: 6px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .pt-cards-grid {
    grid-template-columns: 1fr;
  }

  .pt-card-primary {
    padding: 16px 18px;
  }

  .pt-gauge-outer,
  .pt-gauge-scale {
    width: 150px;
  }
}




.pt-card-merged {
    width: 100%;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    margin-top: 20px;
}

.pt-card-merged h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: #fff;
    font-size: 18px;
}

.pt-card-merged .pt-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    white-space: nowrap;
}

.pt-card-merged .pt-list li span {
    width: 22px;
    flex-shrink: 0;
    font-size: 1.1rem;
}


@media (max-width: 480px) {
  .menu {
    width: 220px;
    left: -220px;
  }
  .menu-btn {
    width: 44px;
    height: 44px;
  }
}


/* Small phones (<400px) */
@media (max-width: 400px) {
  .page-header h1 { font-size: 1.6rem; }
  .map-canvas { height: 300px; }
}

/* Phones (<720px) */
@media (max-width: 720px) {
  .page-shell { padding: 72px 14px 24px; }
  .input-group { flex-direction: column; align-items: stretch; }
  .button-row { justify-content: flex-start; }
}

/* Tablets (<960px) */
@media (max-width: 960px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
}
