/* ============================================================
   Weather Card — Glass Sidebar Design
   ============================================================ */

/* --- Container --- */
.weather-container {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  padding: 10px 12px;
  border-radius: var(--radius, 20px);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.weather-container *,
.weather-container *::before,
.weather-container *::after {
  box-sizing: border-box;
}

.weather-container > * {
  position: relative;
  z-index: 1;
}

/* Admin-uploaded background photo (blurred, cover) */
.weather-container.has-bg::before,
.weather-container.has-bg::after {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: 0;
  pointer-events: none;
}

.weather-container.has-bg::before {
  background-image: var(--weather-bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(0px) saturate(1.05) brightness(0.96);
  transform: scale(1.0);
}

.weather-container.has-bg::after {
  background: linear-gradient(
    160deg,
    rgba(10, 18, 40, 0.32),
    rgba(10, 18, 40, 0.14) 45%,
    rgba(10, 18, 40, 0.34)
  );
}

.weather-container.has-bg {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* --- Top Bar --- */
.weather-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  flex: 0 0 auto;
  height: 26px;
}

.wt-location {
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  padding: 3px 12px;
  border-radius: 50px;
  white-space: nowrap;
  box-shadow: none;
}

.wt-location i {
  font-size: 0.6rem;
}

.wt-updated {
  font-size: 0.5rem;
  opacity: 0.75;
  font-weight: 500;
}

/* --- Glass Panels --- */
.wc-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

/* --- Current weather block --- */
.cs-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cs-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.cs-temp {
  font-size: 2.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}

.cs-temp span {
  font-size: 1.3rem;
  font-weight: 500;
  vertical-align: super;
  letter-spacing: 0;
}

.cs-desc {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.92;
  line-height: 1.35;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Metrics 2x2 grid --- */
.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.cs-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cs-cell i {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.cs-cell:nth-child(1) i {
  color: #fb923c;
}
.cs-cell:nth-child(2) i {
  color: #7dd3fc;
}
.cs-cell:nth-child(3) i {
  color: #e2e8f0;
}
.cs-cell:nth-child(4) i {
  color: #fcd34d;
}

.ccl-label {
  font-size: 0.62rem;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
}

.ccl-value {
  font-size: 0.85rem;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

/* --- Tab Panel (Notice / Forecast / Traffic) --- */
.info-marquee {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  padding: 10px 12px;
}

.marquee-viewport {
  height: 100%;
  overflow: hidden;
  position: relative;
}

.marquee-track {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: transform 0.45s ease;
}

.marquee-track[hidden] {
  display: none;
}

.marquee-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 9px;
  background: transparent;
  border: 1px solid var(--mi-color, rgba(255, 255, 255, 0.25));
  border-radius: 10px;
  flex-shrink: 0;
}
}

.mi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: none;
}

.mi-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mi-title {
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-desc {
  font-size: 0.55rem;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Forecast track (7 columns) --- */
.forecast-track {
  position: static !important;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none !important;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  width: 100%;
  gap: 4px;
}

.forecast-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 2px;
  border-radius: 10px;
  transition: background 0.25s ease;
  cursor: default;
}

.forecast-box:hover {
  background: transparent;
}

.fb-day {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  opacity: 0.92;
  line-height: 1.2;
  white-space: nowrap;
}

.fb-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.fb-temps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}

.fb-high {
  font-size: 0.75rem;
  font-weight: 700;
}

.fb-low {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.65;
}

/* --- Bottom Tabs (metallic pills) --- */
.bottom-tabs {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex: 0 0 auto;
  height: 34px;
}

.tab-btn {
  flex: 1;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  color: white;
  background: transparent;
  box-shadow: none;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  min-width: 0;
}

.tab-btn i {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.tab-btn.active {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.72)
  );
  color: #1d4ed8;
  text-shadow: none;
  box-shadow: none;
}

.tab-btn:hover {
  transform: translateY(-1px);
}

.tab-btn:active {
  transform: translateY(0);
}

/* ============================================================
   Mobile (<768px) — exact 25vh
   ============================================================ */
@media (max-width: 767.98px) {
  .weather-container {
    padding: 6px 8px;
    gap: 5px;
    height: 25vh;
    min-height: 25vh;
  }

  .weather-top-bar {
    height: 18px;
  }
  .wt-location {
    font-size: 0.45rem;
    padding: 2px 8px;
    gap: 3px;
  }
  .wt-location i {
    font-size: 0.45rem;
  }
  .wt-updated {
    font-size: 0.4rem;
  }

  .wc-panel {
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
  }

  .cs-main {
    gap: 6px;
  }
  .cs-icon {
    width: 34px;
    height: 34px;
  }
  .cs-temp {
    font-size: 1.5rem;
  }
  .cs-temp span {
    font-size: 0.7rem;
  }
  .cs-desc {
    font-size: 0.45rem;
    margin-top: 1px;
  }

  .cs-grid {
    gap: 3px 10px;
  }
  .cs-cell {
    gap: 4px;
  }
  .cs-cell i {
    font-size: 0.6rem;
    width: 12px;
  }
  .ccl-label {
    font-size: 0.4rem;
  }
  .ccl-value {
    font-size: 0.55rem;
  }

  .info-marquee {
    padding: 5px 6px;
    border-radius: 12px;
  }

  .marquee-item {
    padding: 4px 6px;
    gap: 5px;
    border-radius: 8px;
  }
  .mi-dot {
    width: 6px;
    height: 6px;
    margin-top: 2px;
  }
  .mi-title {
    font-size: 0.5rem;
  }
  .mi-desc {
    font-size: 0.42rem;
  }

  .forecast-grid {
    gap: 2px;
  }
  .forecast-box {
    padding: 2px 0;
    gap: 2px;
    border-radius: 8px;
  }
  .forecast-box:hover {
    background: none;
  }
  .fb-day {
    font-size: 0.4rem;
    letter-spacing: 0.2px;
  }
  .fb-icon {
    width: 18px;
    height: 18px;
  }
  .fb-high {
    font-size: 0.5rem;
  }
  .fb-low {
    font-size: 0.42rem;
  }

  .bottom-tabs {
    height: 22px;
    gap: 5px;
  }
  .tab-btn {
    font-size: 0.42rem;
    padding: 2px 6px;
    gap: 3px;
  }
  .tab-btn i {
    font-size: 0.5rem;
  }
}

/* ============================================================
   Tablet (768–991.98px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
  .weather-container {
    padding: 8px 10px;
    gap: 6px;
    height: 25vh;
    min-height: 25vh;
  }

  .weather-top-bar {
    height: 22px;
  }
  .wt-location {
    font-size: 0.52rem;
    padding: 2px 9px;
  }
  .wt-updated {
    font-size: 0.45rem;
  }

  .wc-panel {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .cs-main {
    gap: 10px;
  }
  .cs-icon {
    width: 48px;
    height: 48px;
  }
  .cs-temp {
    font-size: 2rem;
  }
  .cs-temp span {
    font-size: 0.9rem;
  }
  .cs-desc {
    font-size: 0.55rem;
  }

  .cs-grid {
    gap: 6px 12px;
  }
  .cs-cell i {
    font-size: 0.75rem;
    width: 15px;
  }
  .ccl-label {
    font-size: 0.5rem;
  }
  .ccl-value {
    font-size: 0.65rem;
  }

  .info-marquee {
    padding: 8px 10px;
    border-radius: 14px;
  }

  .marquee-item {
    padding: 5px 8px;
    border-radius: 9px;
  }
  .mi-title {
    font-size: 0.55rem;
  }
  .mi-desc {
    font-size: 0.48rem;
  }

  .forecast-grid {
    gap: 3px;
  }
  .fb-day {
    font-size: 0.48rem;
  }
  .fb-icon {
    width: 22px;
    height: 22px;
  }
  .fb-high {
    font-size: 0.6rem;
  }
  .fb-low {
    font-size: 0.52rem;
  }

  .bottom-tabs {
    height: 28px;
    gap: 6px;
  }
  .tab-btn {
    font-size: 0.5rem;
    padding: 3px 8px;
  }
}

/* ============================================================
   Desktop (≥992px) — match hero carousel height exactly
   ============================================================ */
@media (min-width: 992px) {
  .weather-container {
    padding: 10px 14px;
    gap: 10px;
    height: var(--home-feature-height, 450px);
    min-height: var(--home-feature-height, 450px);
  }

  .wc-panel {
    gap: 12px;
    padding: 14px 16px;
  }
}

/* Mid desktop band (768–991px) — hero uses 25vh, match it */
@media (min-width: 768px) and (max-width: 991.98px) {
  .weather-container {
    height: var(--home-feature-height, 25vh);
    min-height: var(--home-feature-height, 25vh);
  }
}

/* ============================================================
   Large Desktop (≥1200px)
   ============================================================ */
@media (min-width: 1200px) {
  .weather-container {
    padding: 12px 16px;
    gap: 12px;
  }

  .wt-location {
    font-size: 0.7rem;
    padding: 3px 14px;
  }

  .wc-panel {
    padding: 16px 18px;
  }

  .cs-icon {
    width: 70px;
    height: 70px;
  }
  .cs-temp {
    font-size: 3.2rem;
  }
  .cs-temp span {
    font-size: 1.4rem;
  }
  .cs-desc {
    font-size: 0.75rem;
  }

  .cs-grid {
    gap: 10px 18px;
  }
  .cs-cell i {
    font-size: 1rem;
    width: 20px;
  }
  .ccl-label {
    font-size: 0.65rem;
  }
  .ccl-value {
    font-size: 0.9rem;
  }

  .info-marquee {
    padding: 12px 14px;
  }

  .marquee-item {
    padding: 7px 11px;
  }
  .mi-title {
    font-size: 0.7rem;
  }
  .mi-desc {
    font-size: 0.6rem;
  }

  .fb-day {
    font-size: 0.6rem;
  }
  .fb-icon {
    width: 28px;
    height: 28px;
  }
  .fb-high {
    font-size: 0.8rem;
  }
  .fb-low {
    font-size: 0.7rem;
  }

  .bottom-tabs {
    height: 36px;
  }
  .tab-btn {
    font-size: 0.65rem;
    padding: 5px 14px;
  }
  .tab-btn i {
    font-size: 0.75rem;
  }
}
