/* ============================================================
   Weather Card — Premium Design System
   ============================================================ */

/* --- Container --- */
.weather-container {
  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: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

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

.wt-location {
  font-size: 0.6rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  padding: 2px 10px;
  border-radius: 50px;
  white-space: nowrap;
}

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

.wt-updated {
  font-size: 0.45rem;
  opacity: 0.7;
  font-weight: 500;
}

/* --- Carousel (2 slides) --- */
.weather-carousel {
  position: relative;
  flex: 0 0 auto;
  min-height: 90px;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  height: 100%;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  box-sizing: border-box;
}

/* --- Slide 0: cs-layout (main + 2x2 grid) --- */
.cs-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  justify-content: center;
  gap: 6px;
}

.cs-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.cs-temp {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.cs-temp span {
  font-size: 0.9rem;
  font-weight: 400;
  vertical-align: super;
}

.cs-desc {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.cs-cell {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cs-cell i {
  font-size: 0.75rem;
  opacity: 0.8;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

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

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

/* --- Slide 1: Forecast Strip --- */
.cs-forecast {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  padding: 2px;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
  mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
}

.cs-forecast::-webkit-scrollbar {
  display: none;
}

.csf-day {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  width: 44px;
  padding: 4px 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

.csf-label {
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.csf-icon {
  width: 20px;
  height: 20px;
}

.csf-high {
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
}

.csf-low {
  font-size: 0.45rem;
  opacity: 0.6;
  line-height: 1;
}

/* --- Dots --- */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 2px 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.3s ease;
  cursor: pointer;
}

.dot.active {
  width: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
}

/* --- Info Marquee --- */
.info-marquee {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

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

.marquee-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
  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: 6px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  flex-shrink: 0;
}

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

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

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

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

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

.forecast-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 5px;
  padding: 2px;
}

.forecast-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 0 0;
  min-width: 0;
  padding: 6px 3px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 4px 4px 8px rgba(15,23,42,0.08), -3px -3px 6px rgba(255,255,255,0.2);
  transition: all 0.3s ease;
  cursor: default;
}

.forecast-box:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-3px);
  box-shadow: 6px 6px 12px rgba(15,23,42,0.1), -4px -4px 8px rgba(255,255,255,0.25);
  border-color: rgba(255, 255, 255, 0.35);
}

.fb-day {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.85;
  line-height: 1.2;
}

.fb-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin: 1px 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

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

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

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

/* --- Bottom Tabs --- */
.bottom-tabs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex: 0 0 auto;
  height: 28px;
}

.tab-btn {
  flex: 1;
  border: none;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.55rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tab-btn i {
  font-size: 0.65rem;
}

.tab-btn.active {
  background: white;
  color: #2563eb;
}

.tab-btn:hover {
  transform: scale(1.04);
}

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

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

  .weather-carousel {
    min-height: 60px;
    flex: 1;
  }

  .carousel-slide {
    padding: 2px 0;
  }

  .cs-layout {
    gap: 3px;
  }

  .cs-main {
    gap: 6px;
  }
  .cs-icon {
    width: 32px;
    height: 32px;
  }
  .cs-temp {
    font-size: 1.2rem;
  }
  .cs-temp span {
    font-size: 0.6rem;
  }
  .cs-desc {
    font-size: 0.45rem;
  }

  .cs-grid {
    gap: 2px 6px;
  }
  .cs-cell i {
    font-size: 0.6rem;
    width: 13px;
  }
  .ccl-label {
    font-size: 0.4rem;
  }
  .ccl-value {
    font-size: 0.55rem;
  }

  .cs-forecast {
    gap: 4px;
    padding: 1px;
  }
  .csf-day {
    width: 36px;
    padding: 3px 2px;
    border-radius: 8px;
    gap: 0;
  }
  .csf-label {
    font-size: 0.38rem;
  }
  .csf-icon {
    width: 16px;
    height: 16px;
  }
  .csf-high {
    font-size: 0.45rem;
  }
  .csf-low {
    font-size: 0.4rem;
  }

  .carousel-dots {
    padding: 1px 0;
    gap: 4px;
  }
  .dot {
    width: 5px;
    height: 5px;
  }
  .dot.active {
    width: 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: 3px;
    padding: 1px;
  }

  .forecast-box {
    padding: 3px 2px;
    border-radius: 8px;
    gap: 1px;
  }

  .forecast-box:hover {
    transform: none;
  }

  .fb-day {
    font-size: 0.4rem;
  }

  .fb-icon {
    width: 16px;
    height: 16px;
    margin: 0;
  }

  .fb-high {
    font-size: 0.48rem;
  }

  .fb-low {
    font-size: 0.42rem;
  }

  .bottom-tabs {
    height: 20px;
    gap: 4px;
  }
  .tab-btn {
    font-size: 0.42rem;
    padding: 2px 6px;
    gap: 2px;
  }
  .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: 3px;
    height: 25vh;
    min-height: 25vh;
  }

  .weather-top-bar {
    height: 20px;
  }
  .wt-location {
    font-size: 0.5rem;
    padding: 1px 8px;
  }
  .wt-updated {
    font-size: 0.45rem;
  }

  .weather-carousel {
    min-height: 70px;
    flex: 1;
  }

  .cs-icon {
    width: 38px;
    height: 38px;
  }
  .cs-temp {
    font-size: 1.4rem;
  }
  .cs-desc {
    font-size: 0.5rem;
  }

  .cs-grid {
    gap: 3px 7px;
  }
  .cs-cell i {
    font-size: 0.65rem;
  }
  .ccl-value {
    font-size: 0.6rem;
  }

  .csf-day {
    width: 40px;
  }
  .csf-icon {
    width: 18px;
    height: 18px;
  }
  .csf-high {
    font-size: 0.5rem;
  }

  .forecast-grid {
    gap: 4px;
  }

  .forecast-box {
    padding: 4px 3px;
    border-radius: 10px;
    gap: 2px;
  }

  .fb-day {
    font-size: 0.45rem;
  }

  .fb-icon {
    width: 18px;
    height: 18px;
  }

  .fb-high {
    font-size: 0.52rem;
  }

  .fb-low {
    font-size: 0.45rem;
  }

  .bottom-tabs {
    height: 24px;
  }
  .tab-btn {
    font-size: 0.5rem;
  }
}

/* ============================================================
   Desktop (≥992px)
   ============================================================ */
@media (min-width: 992px) {
  .weather-container {
    padding: 10px 14px;
    gap: 5px;
    min-height: 450px;
  }

  .weather-top-bar {
    height: 24px;
  }
  .wt-location {
    font-size: 0.65rem;
    padding: 2px 12px;
  }
  .wt-updated {
    font-size: 0.5rem;
  }

  .weather-carousel {
    min-height: 112px;
  }

  .cs-icon {
    width: 56px;
    height: 56px;
  }
  .cs-temp {
    font-size: 2.2rem;
  }
  .cs-temp span {
    font-size: 1rem;
  }
  .cs-desc {
    font-size: 0.65rem;
  }

  .cs-layout {
    gap: 8px;
  }
  .cs-main {
    gap: 12px;
  }
  .cs-grid {
    gap: 5px 12px;
  }
  .cs-cell i {
    font-size: 0.85rem;
    width: 18px;
  }
  .ccl-label {
    font-size: 0.55rem;
  }
  .ccl-value {
    font-size: 0.8rem;
  }

  .cs-forecast {
    gap: 8px;
  }
  .csf-day {
    width: 50px;
    padding: 5px 3px;
    gap: 2px;
  }
  .csf-label {
    font-size: 0.5rem;
  }
  .csf-icon {
    width: 22px;
    height: 22px;
  }
  .csf-high {
    font-size: 0.6rem;
  }
  .csf-low {
    font-size: 0.5rem;
  }

  .carousel-dots {
    padding: 3px 0;
  }
  .dot {
    width: 7px;
    height: 7px;
  }
  .dot.active {
    width: 22px;
  }

  .marquee-item {
    padding: 7px 10px;
    gap: 7px;
  }
  .mi-dot {
    width: 8px;
    height: 8px;
    margin-top: 3px;
  }
  .mi-title {
    font-size: 0.65rem;
  }
  .mi-desc {
    font-size: 0.55rem;
  }

  .forecast-grid {
    gap: 6px;
    height: 100%;
  }

  .forecast-box {
    padding: 8px 5px;
    border-radius: 14px;
    gap: 3px;
  }

  .fb-day {
    font-size: 0.55rem;
  }

  .fb-icon {
    width: 24px;
    height: 24px;
  }

  .fb-high {
    font-size: 0.65rem;
  }

  .fb-low {
    font-size: 0.55rem;
  }

  .bottom-tabs {
    height: 32px;
  }
  .tab-btn {
    font-size: 0.6rem;
    padding: 4px 14px;
    gap: 5px;
  }
  .tab-btn i {
    font-size: 0.7rem;
  }
}

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

  .weather-top-bar {
    height: 26px;
  }
  .wt-location {
    font-size: 0.7rem;
  }
  .wt-updated {
    font-size: 0.55rem;
  }

  .weather-carousel {
    min-height: 120px;
  }

  .cs-icon {
    width: 60px;
    height: 60px;
  }
  .cs-temp {
    font-size: 2.4rem;
  }
  .cs-desc {
    font-size: 0.7rem;
  }

  .cs-grid {
    gap: 6px 16px;
  }
  .cs-cell i {
    font-size: 0.9rem;
  }
  .ccl-value {
    font-size: 0.85rem;
  }

  .csf-day {
    width: 54px;
    padding: 6px 4px;
  }
  .csf-icon {
    width: 24px;
    height: 24px;
  }

  .marquee-item {
    padding: 8px 12px;
    gap: 8px;
  }
  .mi-title {
    font-size: 0.7rem;
  }
  .mi-desc {
    font-size: 0.6rem;
  }

  .forecast-grid {
    gap: 7px;
    height: 100%;
  }

  .forecast-box {
    padding: 9px 6px;
    border-radius: 16px;
    gap: 3px;
  }

  .fb-day {
    font-size: 0.6rem;
  }

  .fb-icon {
    width: 26px;
    height: 26px;
  }

  .fb-high {
    font-size: 0.7rem;
  }

  .fb-low {
    font-size: 0.6rem;
  }

  .bottom-tabs {
    height: 34px;
  }
  .tab-btn {
    font-size: 0.65rem;
    padding: 5px 16px;
  }
}
