@import "/docs/css/variables.css";
@import "/docs/css/layout.css";
@import "/css/variables.css";
@import "/css/layout.css";

button {
	background: none;
	color: inherit;
	border: none;
	padding: 0;
	font: inherit;
	cursor: pointer;
	outline: inherit;
}

/* HEADER TEXT */

/* Container: locks icon + text together */
.city-search {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 4px 15px; /* was 6px 12px */
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.06);

  border: 1px solid var(--outline);

  width: fit-content;
  margin: 0 auto;

  transition: all 0.2s ease;
}

.city-search:focus-within {
  background: rgba(255, 255, 255, 0.09);
  border-color: color-mix(in srgb, var(--accent), transparent 60%);
}

.location-icon {
  width: 14px;
  height: 14px;

  margin-right: 5px;

  opacity: 0.7;
  transform: translateY(0.5px);

  filter: brightness(0) saturate(100%)
          invert(48%) sepia(89%) saturate(1450%)
          hue-rotate(190deg);
}

/* Input field */
.location {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;

  background: transparent;
  border: none;
  outline: none;

  padding: 0;
  margin: 0;

  width: auto;
  min-width: 90px;

  text-align: left;

  transition: width 0.12s ease-out;

  font: inherit;
  line-height: 1;
}

/* Placeholder styling */
.location::placeholder {
  color: rgba(120, 180, 255, 0.6);
}

.input-wrap {
  position: relative;
}

/* real input */
.location.real {
  position: relative;
  color: var(--accent);
  z-index: 2;
}

.location.real,
.location.ghost {
  inset: 0;
  padding: 0;
}

/* ghost suggestion */
.location.ghost {
  position: absolute;

  top: 0;
  left: 0;

  color: rgba(120, 180, 255, 0.35);
  pointer-events: none;

  z-index: 1;
}

/* placeholder should NOT show on ghost */
.location.ghost::placeholder {
  color: transparent;
}

.title {
  font-size: clamp(var(--fs-title-min), 6vw, var(--fs-title-max));
  font-weight: 700;
  color: var(--text-white);
  margin-top: 5px;
  letter-spacing: -0.04em;
}

.subtitle {
  font-size: clamp(var(--fs-title-min), 6vw, var(--fs-title-max));
  font-weight: 700;
  color: var(--text-muted);
  margin-top: -2px;
  letter-spacing: -0.04em;
}

/* CARD */

.card {
  width: 100%;
  max-width: 780px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: clamp(24px, 5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 5vw, 36px);
  position: relative;

  background: var(--card-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--outline);
}

.loading-screen {
  position: absolute;
  inset: 0;

  font-size: 18px;

  background:
    radial-gradient(circle at 50% 50%, transparent 0%, var(--loading-stripe-light) 0%);

  border-radius: 20px;
  z-index: 10;
}

.loading-text {
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 600;
  color: var(--text-muted);
}

.dotdotdot::after {
  content: '';
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

.loading-screen.hidden {
  animation: loading-screen-fading 1s ease forwards;
}

@keyframes loading-screen-fading {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    display: none;
  }
}
/* TOMORROW */

.current {
  text-align: center;
}

.current-percent {
  font-size: clamp(var(--fs-tomorrow-min), 12vw, var(--fs-tomorrow-max));
  font-weight: bold;
  color: var(--text-white);
  letter-spacing: -0.04em;

  display: inline-flex;
  align-items: baseline; /* aligns % nicely */
  gap: 0.08em;           /* controls spacing */

  margin-bottom: -5px;
}

.percent-sign {
  font-size: .93em;     /* % should be smaller */
  font-weight: bold;
  margin-left: -5px;
}

.current-label {
  font-size: clamp(var(--fs-tomorrow-min), 10vw, var(--fs-tomorrow-max));
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-top: clamp(-20px, -4vw, -30px);
}

.odometer-digit {
  margin-bottom: 6px;
  font-family: "Inter", system-ui, sans-serif;
}

.odometer-digit:last-child {
  margin-right: 0;
}

/* Reasons */

.reasons {
  text-align: center;
  justify-content: center;
  margin-top: -15px;
  gap: 10px;
}

.reasons.is-hidden {
  display: none;
  height: 0;
  width: 0;
}

.reason {
  font-size: clamp(var(--fs-metric-label-min), 3.5vw, var(--fs-metric-label-max));
  font-weight: 600;
  color: var(--text-muted);
  background: #2d2d2d;
  border: var(--reason-outline);
  border-radius: 12px;
  letter-spacing: -0.02em;
  padding: 6px 10px;
  text-align: center;

  /* collapsed pre-load state */
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  filter: blur(2px);

  /* 👇 no gap while loading */
  margin: 0 0;

  will-change: transform, opacity, filter, margin;
}

/* trigger animation */
.reasons.animate .reason {
  animation: reason-pop 1s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

a[href] {
  color: var(--accent-pink);
  text-decoration: underline;
}

strong {
  font-weight: 1000;
}

.reason.warning {
  width: 100%;

  flex-direction: column;

  padding: clamp(14px, 3vw, 20px);
  border-radius: 14px;

  font-size: clamp(var(--fs-alert-label-min), 3.5vw, var(--fs-alert-label-max));
  font-weight: 600;
  color: var(--text-white);
  text-align: center;
  letter-spacing: 0.02em;

  /* override pop animation cleanly */
  opacity: 1;
  transform: none;
  filter: none;
}

.warning-label {
  flex-direction: column;
}

.warning-time {
  font-size: clamp(8px, 2.5vw, 14px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Environment Canada strip */
.warning-label::before {
  content: "Environment Canada";
  font-size: clamp(8px, 2.5vw, 11px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;

  color: var(--text-white);

  opacity: 0.75;
  margin-bottom: 6px;
}

.dropdown-line {
  width: 100%;
  height: 1px;
  background: var(--outline);
  margin-top: clamp(20px, 3vw, 30px);
  margin-bottom: clamp(10px, 3vw, 18px);

  align-items: center;
  justify-content: center;
  display: flex;
}

.dropdown-button {
  width: clamp(20px, 6vw, 32px);
  height: clamp(20px, 6vw, 32px);
  border-radius: 50%;
  background: #2d2d2d;

  rotate: 0deg;

  font-weight: 200;
  color: var(--text-white);

  outline: 1px solid var(--outline);
  z-index: 5;
}

.dropdown-button .pressed {
  animation: rotateArrow 0.3s ease forwards;
}

@keyframes rotateArrow {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

@keyframes reason-pop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(1);
    filter: blur(2px);
    margin: 0 6;
  }
  50% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    filter: blur(0);
    margin: 0 8px;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    margin: 0 6;
  }
}

/* accessibility */
@media (prefers-reduced-motion: reduce) {
  .reason {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    margin: 0 6px !important;
  }
}

/* Others Counter */

.others {
  position: absolute;  /* << frees layout, floats it */
  top: 1;
  right: 0;
  margin-left: auto;
  align-self: flex-start;
  display: flex;
  width: clamp(80px, 27vw, 225px);
  margin-top: 32px;
  margin-right: 24px; 
}

.others-amount {
  font-size: clamp(var(--fs-others-label-min), 2.5vw, var(--fs-others-label-max));
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-top: clamp(-20px, -4vw, -30px);
  text-align: center;
}

.others-text {
  font-size: clamp(var(--fs-others-label-min), 2.5vw, var(--fs-others-label-max));
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-top: clamp(-20px, -4vw, -30px);
  text-align: center;
}

.others-amount .odometer-digit {
  font-family: "Inter", system-ui, sans-serif;
  margin-bottom: 3px;
}

@media (max-width: 600px) {
  .others-amount .odometer-digit {
    font-family: "Inter", system-ui, sans-serif;
    margin-bottom: 1px;
  }

  .others {
    position: relative;  /* << frees layout, floats it */
    top: 0;
    right: 0;
    margin-left: 0;
    align-self: center;
    display: flex;
    width: auto;
    margin-top: 0px;
    margin-right: 0px; 
  }
}

/* DIVIDER */

.line {
  width: 100%;
  max-width: 690px;
  height: 5px;

  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent-pink) 50%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  animation: slideDivider 3s linear infinite;

  margin: 0 auto;
  border-radius: 10px;

  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.363);
}

@keyframes slideDivider {
  0%   { background-position: 0% center; }
  100% { background-position: -200% center; }
}

.forecast-label {
  font-size: clamp(var(--fs-metric-label-min), 3vw, var(--fs-metric-label-max));
  font-weight: 700;
  background: var(--text-white);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
  text-align: center;
  margin-top: -5px;
}

/* METRICS */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 3vw, 18px);
  margin-top: -15px;
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: clamp(var(--fs-metric-value-min), 8vw, var(--fs-metric-value-max));
  font-weight: bold;
  color: var(--text-white);
  letter-spacing: -0.04em;

  display: inline-flex;
  align-items: baseline; /* aligns % nicely */
  gap: 0.08em;           /* controls spacing */
}

.metric-value-icon {
  font-size: clamp(var(--fs-metric-value-min), 8vw, var(--fs-metric-value-max));
  font-weight: bold;
  color: var(--text-white);
  letter-spacing: -0.04em;
}

.metric-label {
  font-size: clamp(var(--fs-metric-label-min), 3.5vw, var(--fs-metric-label-max));
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-top: 4px;
}

/* DISCLAIMER */
.disclaimer {
  font-size: clamp(10px, 2.5vw, 14px);
  font-weight: 399;
  color: var(--text-muted);
  text-align: center;
  margin-top: -10px;
  margin-bottom: -10px;

  letter-spacing: 0.01em;
}


/* UPCOMING UPDATES CARD */

.upcoming-updates-label {
  font-size: clamp(var(--fs-metric-label-min), 3vw, var(--fs-metric-label-max));
  font-weight: 700;
  background: var(--text-white);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
  text-align: left;
  margin-top: -5px;
}

.upcoming-updates-label.has-time::after {
  margin-left: 8px;
  content: "Last updated Feb 26, 2026";
  font-size: clamp(8px, 2.5vw, 14px);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.10em;
}

.upcoming-updates-content {
  font-size: clamp(var(--fs-others-label-min), 2.5vw, var(--fs-others-label-max));
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  margin-top: 8px;
  line-height: 1.4;
}

/* MOBILE */

@media (max-width: 600px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
  }
}

/* FOOTER */

.footer {
  background: #ffffff;
  color: #000000;
  padding: 40px 24px;
  flex-shrink: 0;

  margin-top: 50px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.suggest-box {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;

  font-size: 14px;
  border-radius: 12px;
  border: 1px solid #cccccc;

  resize: vertical;
}

.suggest-btn {
  margin-top: 10px;
  padding: 10px 16px;

  border-radius: 10px;
  border: none;
  cursor: pointer;

  font-weight: 600;
  background: black;
  color: white;
}

.suggest-btn:hover {
  opacity: 0.85;
}

.submit-status {
  font-size: 13px;
  margin-top: 8px;
}

/* Safari AutoFill / Contacts icon */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button,
input::-webkit-search-cancel-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}
