/* color */
:root {
  --primary: #2B689C; /* màu xanh dương mặc định, bạn có thể thay bằng mã màu khác */
}
/* Reset mặc định */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  footer {
    margin-top: 40px;     /* tăng hoặc giảm px tuỳ ý */
  }

  .hero {
    margin-bottom: 40px;
  }
  
  body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    overflow-x: hidden;
  }
  
  /* HEADER */
  .navbar {
    background-color: white;
    padding: 7px 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
  .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .logo {
    height: 65px;
  }
  
  .nav-tabs {
    list-style: none;
    display: flex;
    gap: 24px;
  }
  
  .nav-tabs li {
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    color: #2c3e50;
    transition: background 0.3s;
  }
  
  .nav-tabs li:hover,
  .nav-tabs li.active {
    background-color: #e6f1ff;
    color: var(--primary);
  }
  
  /* HERO SECTION */
  .hero {
    background-color: var(--primary);
    color: white;
    text-align: center;
    padding: 150px 20px;
  }
  
  .hero-content {
    max-width: 800px;
    margin: auto;
  }
  
  .hero h1 {
    font-size: 56px;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -1px;
  }
  
  .hero p {
    font-size: 20px;
    font-weight: 300;
    margin-bottom: 30px;
  }
  
  .btn-geoportal {
    background-color: #2c3e50;
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    transition: background 0.3s;
  }
  
  .btn-geoportal:hover {
    background-color: #1c2d3f;
  }
  
  /* MAIN CONTENT */
  section h2 {
    font-size: 32px;
    margin-bottom: 20px;
    text-align: left;
    color: var(--primary);
  }

  .section-header-divider {
    border: none;
    height: 2px;
    background-color: var(--primary);
    margin: 10px 0 20px;
    margin-bottom: 20px;
  }

/* Feature 1: calculate wqi */

  .card {
    border: 1px solid #ddd;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    background-color: #fff;
  }
  
  .card-header {
    background-color: #f2f2f2;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }
  
  .card-body {
    padding: 16px 20px;
  }

  .btn-calc {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
  }

  .centered-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .btn-calc:hover {
    background-color: #0056b3;
  }
  
  .btn-download {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    width: 220px;
    margin-bottom: 10px;
    margin-top: 10px
  }
  
  .btn-download:hover {
    background-color: #0056b3;
  }
  
  .status-message.success {
    color: #2e7d32;
    margin-bottom: 10px;
    font-weight: bold;
  }
  
  .btn-download {
    display: inline-block;
    padding: 10px 16px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
  }

  #wqi-map {
    width: 100%;
    max-width: 1300px;
    height: 600px;
    margin: 0 auto;

  }
  .wqi-map--has-border {
    border: 3px solid var(--primary);
    border-radius: 4px;   /* tuỳ chọn bo góc */
    box-sizing: border-box;
  }

  .info.legend {
    background: white;
    padding: 8px;
    line-height: 1.4;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    width: 300px;
    font-size: 18px;
  }
  .info.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.8;
  }

  /* Tăng font-size và line-height cho nội dung popup */
  .leaflet-popup-content {
    font-size: 1rem;       /* hoặc 16px, 18px tuỳ bạn */
    line-height: 1.5;
    text-align: left;
  }

  /* Tăng chiều rộng tối đa của popup */
  .leaflet-popup-content-wrapper {
    max-width: 300px;      /* thay đổi nếu muốn rộng hơn */
  }

  /* (Tuỳ chọn) Tăng padding bên trong */
  .leaflet-popup-content-wrapper .leaflet-popup-content {
    padding: 10px 14px;    /* top/bottom 10px, left/right 14px */
  }

  /* (Tuỳ chọn) Tăng kích thước mũi tên */
  .leaflet-popup-tip-container .leaflet-popup-tip {
    width: 16px;
    height: 16px;
    margin-left: 12px
  }
  

/* Feature 2: Predict wqi */
.wqi-form-container {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin: auto;
}

.wqi-form-container h2 {
  margin-bottom: 20px;
}

.wqi-form-container .form-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.wqi-form-container label {
  flex: 1;
  font-weight: 500;
}

.wqi-form-container select {
  flex: 2;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 400px;
}

.wqi-form-container input {
  flex: 2;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 400px;
}

.wqi-form-container button {
  padding: 10px 20px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

#wqi-location-form .submit {
  display: block;
  margin: 20px auto 0; /* 20px khoảng trên, auto 2 bên để căn giữa */
}

.wqi-form-container button:hover {
  background-color: #0056b3;
}

#predict-result {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  background-color: #f5f5f5;
}

#wl-forecast {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  background-color: #f5f5f5;
}

.result-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-top: 20px;
  animation: fadeIn 0.3s ease;
}

.result-title {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.result-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.result-label {
  flex: 1;
  font-weight: 500;
  color: #555;
}

.result-value {
  flex: 2;
  font-weight: bold;
  font-size: 16px;
  color: #111;
  text-align: right;
}

.result-badge {
  background-color: #eee;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  color: #222;
  border: 1px solid #ccc;
  margin-left: auto;
}

.color-tag {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid #999;
}

.color-code {
  font-family: monospace;
  color: #444;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}


  
  
  /* FOOTER */
  .footer {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: white;
    background-color: var(--primary);
    border-top: 1px solid #ccc;
  }
  
  .footer a {
    color: white;
    text-decoration: none;
  }
  
  .footer a:hover {
    text-decoration: underline;
  }


  /* Toggle switch - dùng chung biến --primary đã có */
.wl-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #2c3e50;
}

.wl-switch { 
  margin-bottom: 18px; /* chỉnh 8–24px tuỳ ý */
}

.wl-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wl-switch-track {
  --track-w: 48px;
  --track-h: 28px;
  position: relative;
  width: var(--track-w);
  height: var(--track-h);
  background: #e6eaf0;
  border: 1px solid #d3d9e0;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.wl-switch-thumb {
  --thumb: 22px;
  position: absolute;
  top: 50%;
  left: 3px;
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transform: translateY(-50%);
  transition: left 0.2s ease, width 0.15s ease;
}

/* Checked */
.wl-switch input:checked + .wl-switch-track {
  background: color-mix(in srgb, var(--primary) 20%, #ffffff 80%);
  border-color: var(--primary);
}

.wl-switch input:checked + .wl-switch-track .wl-switch-thumb {
  left: calc(100% - 3px - var(--thumb));
}

/* Hover/focus states */
.wl-switch:hover .wl-switch-track {
  border-color: #b7c0cc;
}

.wl-switch input:focus-visible + .wl-switch-track {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 2px;
}

/* Disabled (nếu cần) */
.wl-switch input:disabled + .wl-switch-track {
  opacity: 0.6;
  cursor: not-allowed;
}
.wl-switch input:disabled ~ .wl-switch-text {
  opacity: 0.6;
}

/* Size variants (tuỳ chọn) */
.wl-switch--sm .wl-switch-track { --track-w: 38px; --track-h: 22px; }
.wl-switch--sm .wl-switch-thumb { --thumb: 18px; }

.wl-switch--lg .wl-switch-track { --track-w: 60px; --track-h: 34px; }
.wl-switch--lg .wl-switch-thumb { --thumb: 28px; }

/* Giảm animation nếu người dùng chọn reduce motion */
@media (prefers-reduced-motion: reduce) {
  .wl-switch-track, .wl-switch-thumb { transition: none; }
}

.form-cell-right {
  flex: 2;
  display: flex;
  justify-content: flex-end; 
}

/* 1) Khai báo 1 lần (đặt gần :root của bạn) */
:root { --control-width: 400px; }

/* 2) Cho input/select dùng đúng biến này (thay width: 400px cũ) */
.wqi-form-container select,
.wqi-form-container input {
  width: var(--control-width);
}

/* 3) Quan trọng: cố định cột phải của hàng toggle bằng flex-basis */
.form-cell-right {
  display: flex;
  justify-content: flex-end;          /* đẩy toggle sát mép phải của cột */
  flex: 0 0 var(--control-width);     /* = 400px, khớp với input/select */
}


/* Làm đẹp thanh cuộn cho hộp Legend */
.info.legend::-webkit-scrollbar {
    width: 6px; /* Làm thanh cuộn mỏng lại */
}
.info.legend::-webkit-scrollbar-track {
    background: transparent; /* Ẩn rãnh cuộn */
}
.info.legend::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3); /* Màu thanh cuộn hơi trong suốt */
    border-radius: 10px; /* Bo tròn thanh cuộn */
}
.info.legend::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5); /* Sáng lên khi di chuột vào */
}
  