/* CSS สำหรับหน้า main.html */

/* ====== Layout ====== */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  font-family: 'IBM Plex Sans Thai', sans-serif;
}

.ontopConatiner {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.ontoplabel {
  margin: 10px 10px 10px 110px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.ontoplabel img {
  /* width: 50px */
  width: 44px;
}

.ontoplabel a {
  text-decoration: none;
}

.ontoplabel span {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 5;
  color: #333 !important
}

.ontoplabel span h3 {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-weight: 800;
  /* font-size: 1.3em; */
  font-size: 1.2em;
  white-space: nowrap;
  margin: 0;
  line-height: 1.5em;
  display: block;

}

.ontoplabel span h4 {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-weight: 600;
  /* font-size: 1.1em; */
  font-size: 0.9em;
  white-space: nowrap;
  line-height: 0;
  margin: 0;
  line-height: 1em;
  display: block;
}

.mobile-header-title h3 {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-weight: 800;
  font-size: 1.3em;
  white-space: nowrap;
  margin: 0;
  line-height: 1.5em;
  display: block;
}

.mobile-header-title h4 {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-weight: 600;
  font-size: 1.1em;
  white-space: nowrap;
  line-height: 0;
  margin: 0;
  line-height: 1em;
  display: block;
}

.shortname {

  display: none;
}

@media (max-width: 992px) {

  .ontopConatiner {
    display: none;
  }
}

@media (max-width: 480px) {
  .shortname {
    font-weight: 800;
    font-size: 1.2em;
    color: #333;
    display: block;
  }

  .mobile-header-title h3,
  .mobile-header-title h4 {
    display: none;
  }
}

/* Main content area */
#main-content {
  margin-left: 90px;
  height: 100vh;
  overflow: auto;
  transition: margin 0.3s ease;
}

/* Menu Background Overlay */
.menu-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
}

.menu-bg-overlay.active {
  display: block;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  z-index: 9999;
  display: none;
  flex-direction: column;
}

@media (min-width: 768px) {
  .menu-overlay {
    width: 20%;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
}

.menu-overlay.active {
  display: flex;
}

.menu-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
}

.menu-logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.overlay-logo {
  height: 50px;
  width: auto;
}

.overlay-title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  line-height: 1.2;
}

.menu-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 10px;
}

.menu-nav {
  flex: 1;
  /* padding: 20px; */
  display: flex;
  flex-direction: column;
  /* gap: 15px; */
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  transition: background-color 0.2s;
}

.menu-item:hover {
  background-color: #e9e9e9;
}

.menu-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.menu-footer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-top: 1px solid #ddd;
}

.menu-footer-link {
  color: #666;
  text-decoration: none;
  font-size: 14px;
}

.menu-footer-link:hover {
  color: #333;
}

/* Sidebar overlay styles moved to left_menu.css */
#sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  height: calc(100vh - 60px);
  width: 320px;
  background-color: #fff;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

/* Expanded sidebar for search results */
.sidebar.expanded {
  width: 400px;
}

/* Search Sidebar */
.search-sidebar {
  position: fixed;
  /* top: 0; */
  /* top: 78px; */
  top: 68px;
  left: 90px;
  width: 420px;
  height: 100vh;
  background-color: #E4E3E3;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  z-index: 999;
  /* ต่ำกว่า sidebar เดิมเล็กน้อย */
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.search-sidebar.active {
  transform: translateX(0);
}

/* ปรับ main content เมื่อ search sidebar แสดง */
.search-sidebar.active+#main-content {
  margin-left: 490px;
  /* 90px (sidebar) + 400px (search sidebar) */
  transition: margin-left 0.3s ease;
}

.search-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
}

.search-sidebar-header h4 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.search-sidebar-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.search-sidebar-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

/* Search Sidebar Header */
.search-sidebar-header {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  gap: 10px;
}

/* Search Box in Search Sidebar */
.search-sidebar .search-box {
  flex: 1;
}

.search-sidebar .search-input-group {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #ddd;
  overflow: hidden;
}

.search-sidebar .search-input {
  flex: 1;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  background: transparent;
}

.search-sidebar .search-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  color: #666;
  cursor: pointer;
  transition: color 0.2s;
}

.search-sidebar .search-btn:hover {
  color: #333;
}

/* Search Results Container */
.search-results-container {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  background-color: #E4E3E3;
}

/* No Results Message */
.no-results {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Station Block */
.station-block {
  padding: 6px;
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.station-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Station Content */
.station-content {
  padding: 10px 15px;
  flex: 1;
}

.station-title {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.station-location,
.station-department {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: #3e4c5a;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
  padding: 6px 10px;
  background: #f7f9fb;
  border-radius: 10px;
  border: 1px solid #e3eef6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.station-location i,
.station-department i {
  color: #1b5e8a;
  font-size: 0.9rem;
  margin-top: 1px;
}

.station-location span,
.station-department span {
  flex: 1;
  word-break: break-word;
}

.station-date {
  margin: 0 0 5px 0;
  font-size: 12px;
  color: #666;
}

/* Station Status */
.station-status-row {
  margin-bottom: 6px;
  padding: 0 15px;
}

.station-status {
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.5px;
}

.status-online {
  color: #23b04a;
  font-weight: 600;
}

.status-offline {
  color: #e74c3c;
  font-weight: 600;
}

/* Station Data Grid */
.station-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 4px;
  padding: 0 15px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-label {
  margin: 0;
  font-size: 13px;
  color: #333;
}

.data-value {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #000;
}

/* Station Image */
.station-image {
  /* height: 120px; */
  padding: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.station-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Substation (หมู่บ้านครอบคลุม) styling */
.station-substation {
  background: #f7f9fb;
  border: 1px solid #e3eef6;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 10px 10px 10px;
}

.substation-header {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1b5e8a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.substation-header i {
  color: #1b5e8a;
}

.substation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.substation-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0f3d5e;
  border: 1px solid #d6e6f3;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.substation-tag i {
  color: #1a73e8;
  font-size: 0.8rem;
}

/* .substation-tag:hover {
    border-color: #b9d6f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
} */

/* Station Buttons */
.station-buttons {
  padding: 8px 8px 8px 8px;
  /* border-top: 1px solid #eee; */
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.station-buttons .row,
.station-buttons .col-4 {
  margin: 0;
  padding: 0;
}

.station-buttons .radius-btn {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  padding: 6px 0;
  text-align: center;
  white-space: nowrap;
  border-radius: 6px;
  margin: 0;
}

.btn-teal {
  background-color: #00a67d;
  color: white;
}

.btn-teal:hover {
  background-color: #008c69;
  color: white;
}


.radius-btn i {
  margin-right: 5px;
}

/* ====== Main Content ====== */
#main-content {
  margin-left: 90px;
  height: 100vh;
  transition: margin-left 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* ====== Button Group ====== */
#dataTypeSelector .btn {
  position: relative;
  /* padding: 0.375rem 0.75rem; */
  padding: 0.375rem 0.2rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  border: 1px solid #dee2e6;
  flex: 1;
}

#dataTypeSelector .btn.active {
  background-color: #fd7e14;
  color: white;
  border-color: #fd7e14;
}

#dataTypeSelector .btn.active .fa-check-circle {
  display: inline-block !important;
  color: white;
}

#dataTypeSelector .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#dataTypeSelector .btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

#dataTypeSelector .btn:not(:last-child) {
  border-right: none;
}

#dataTypeSelector .btn:hover:not(.active) {
  background-color: #f8f9fa;
}

/* ====== Top Menu Bar ====== */
.top-menu-bar {
  background-color: transparent;
  padding: 15px 0;
  position: absolute;
  /* top: 60px; */
  top: 50px;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 10px;
  pointer-events: none;
  /* ทำให้คลิกทะลุผ่านไปยังแผนที่ได้ */
}

.top-menu-bar .container-fluid,
.top-menu-bar .row,
.top-menu-bar .col-md-3,
.top-menu-bar .data-selector,
.top-menu-bar .location-selector,
.top-menu-bar .search-box,
.top-menu-bar .station-buttons,
.top-menu-bar .form-select,
.top-menu-bar .form-control,
.top-menu-bar .input-group,
.top-menu-bar .btn {
  pointer-events: auto;
  /* ให้คลิกที่องค์ประกอบภายในได้ */
}

.top-menu-bar .form-select,
.top-menu-bar .form-control,
.top-menu-bar .btn-outline-secondary {
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#sidebar .sidebar-lang {
  margin-top: auto;
  padding: 20px 18px 24px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

#sidebar .sidebar-lang .btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#sidebar .sidebar-lang .btn-lang {
  width: 100%;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 0;
  line-height: 1.15;
  color: rgba(87, 87, 87, 0.28);
  background: transparent;
  border: 1.5px solid rgba(87, 87, 87, 0.28);
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: none;
}

#sidebar .sidebar-lang .btn-lang:hover,
#sidebar .sidebar-lang .btn-lang:focus {
  background: rgba(106, 196, 251, 0.18);
  color: rgba(106, 196, 251, 1);
  border-color: rgba(106, 196, 251, 0.6);
  text-decoration: none;
  transform: translateY(-1px);
}

#sidebar .sidebar-lang .btn-lang:active {
  transform: translateY(0);
}

#sidebar .sidebar-lang .btn-lang:focus-visible {
  outline: 2px solid rgba(106, 196, 251, 0.7);
  outline-offset: 2px;
}

#sidebar .sidebar-lang .btn-lang.active {
  background: rgba(106, 196, 251, 0.18);
  color: rgba(106, 196, 251, 1);
  border-color: rgba(106, 196, 251, 0.6);
  font-weight: 700;
}

@media (max-width: 992px) {
  #sidebar .sidebar-lang {
    padding: 16px 14px 20px;
  }

  #sidebar .sidebar-lang .btn-lang {
    font-size: 0.76rem;
    padding: 0.44rem 0;
  }
}


.top-menu-bar .form-select:focus,
.top-menu-bar .form-control:focus {
  border-color: #1a9a9a;
  box-shadow: 0 0 0 0.25rem rgba(26, 154, 154, 0.25);
}

/* ====== Floating Warning Box ====== */
.warning-box {
  position: absolute;
  /* top: 90px; */
  top: 126px;
  /* below top menu bar */
  right: 20px;
  z-index: 1100;
  /* background: rgba(255, 255, 255, 0.9); */
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  padding: 10px 12px;
  width: 350px;
  /* container does not scroll; list inside will scroll */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  /* clickable over map */
}

/* Custom scrollbar for warning box */
.warning-list::-webkit-scrollbar {
  width: 8px;
}

.warning-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.warning-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.warning-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

.warning-data-metric .text-warning {
  color: #f9a73e !important;
}

/* Firefox */
.warning-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

/* Make only the list scrollable with a visible max height */
.warning-list {
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* smooth on iOS */
  padding-right: 4px;
  /* room for scrollbar */
}

.warning-box-header {
  /* display: flex; */
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 8px;
}

.warning-box-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #222;
  margin: 0;
}

.warning-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warning-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  /* background: #fff; */
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.warning-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.warning-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 2px;
}

.warning-content {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 2px;
}

.warning-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #111;
}

.warning-name small {
  font-size: 0.83rem;
}

.warning-meta {
  font-size: 0.78rem;
  color: #555;
}

.warning-data {
  font-size: 0.80rem;
  color: #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.warning-data-time {
  white-space: nowrap;
  color: #444;
  font-size: 0.78rem;
}

.warning-data-metric {
  flex: 1 1 auto;
}

.status-color-1 {
  background: #27b376;
}

.status-color-2 {
  background: #f9a73e;
}

.status-color-3 {
  background: #bf212f;
}

/* Hide warning-box toggle by default (desktop); show only in mobile media query below */
.warning-box-toggle {
  display: none;
}

@media (max-width: 768px) {
  .warning-box {
    top: 280px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px - 20px);
    max-width: 420px;
    /* display: none; */
  }

  .warning-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .warning-box-toggle {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 0.9rem;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .warning-box-toggle i {
    pointer-events: none;
  }

  .warning-box.collapsed .warning-box-summary,
  .warning-box.collapsed .warning-list {
    display: none;
  }

  /* When collapsed on mobile, dock the warning box to bottom-left as a small widget */
  .warning-box.collapsed {
    top: auto;
    bottom: 10px;
    left: 10px;
    transform: none;
    width: auto;
    max-width: 260px;
  }
}

.data-selector,
.location-selector,
.search-box {
  padding: 2px;
}

/* ปรับแต่ง input group */
.top-menu-bar .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.top-menu-bar .input-group .btn-outline-secondary {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: #6c757d;
}

.top-menu-bar .input-group .btn-outline-secondary:hover {
  background-color: #e9ecef;
  color: #495057;
}

/* Keyword Suggestions (FilterKeyword) */
.keyword-suggestions {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-height: 340px;
  overflow-y: auto;
  background: #ffffff;
  /* always light */
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.18);
  z-index: 2000;
  display: none;
}

.keyword-suggestions .keyword-suggestion {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.5;
  color: #1f2937;
  /* slate-800 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyword-suggestions .keyword-suggestion:hover,
.keyword-suggestions .keyword-suggestion.active {
  background: #eef4ff;
  /* soft highlight */
}

/* Keep suggestions light even in dark mode */
[data-bs-theme="dark"] .keyword-suggestions,
body.dark-mode .keyword-suggestions {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.28);
}

[data-bs-theme="dark"] .keyword-suggestions .keyword-suggestion,
body.dark-mode .keyword-suggestions .keyword-suggestion {
  color: #111827;
  /* gray-900 */
}

[data-bs-theme="dark"] .keyword-suggestions .keyword-suggestion:hover,
body.dark-mode .keyword-suggestions .keyword-suggestion:hover,
[data-bs-theme="dark"] .keyword-suggestions .keyword-suggestion.active,
body.dark-mode .keyword-suggestions .keyword-suggestion.active {
  background: #eef4ff;
}

.station-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

/* ปุ่มสถานี */
.station-buttons .btn-pill {
  border-radius: 50px;
  /* padding: 0.375rem 1rem; */
  border: none;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.875rem;
}

.station-buttons .btn-pill:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.station-buttons .btn-pill:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Emphasize active state clearly */
.station-buttons .btn-pill.active {
  position: relative;
  filter: brightness(1.08) saturate(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), 0 0 0 2px rgba(255, 255, 255, 0.85);
  outline: 2px solid rgba(0, 0, 0, 0.08);
  outline-offset: 2px;
  transform: translateY(0);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.station-buttons .btn-pill.active:focus,
.station-buttons .btn-pill.active:focus-visible {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(26, 154, 154, 0.25);
}

/* Add a subtle check mark when active */
.station-buttons .btn-pill.active::after {
  content: '\2713';
  /* checkmark */
  margin-left: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.95;
}

.btn-pill {
  white-space: nowrap;
  /* ให้ข้อความอยู่ในบรรทัดเดียว */
  margin: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: white;
}

.btn-pill i {
  margin-right: 4px;
  font-size: 12px;
}

/* สถานีน้ำฝน - สีฟ้า */
.btn-blue {
  background-color: #007aff !important;
  color: #fff !important;
  box-shadow: 0 2px 5px rgba(0, 122, 255, 0.3);
}

/* สถานีระดับน้ำ - สีม่วง */
.btn-purple {
  background-color: #af52de !important;
  color: #fff !important;
  box-shadow: 0 2px 5px rgba(175, 82, 222, 0.3);
}

/* สถานีเตือนภัย - สีแดง */
.btn-red {
  background-color: #ff3b30 !important;
  color: #fff !important;
  box-shadow: 0 2px 5px rgba(255, 59, 48, 0.3);
}

.btn-blue:hover {
  background-color: #0062cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 122, 255, 0.4);
}

.btn-purple:hover {
  background-color: #9b3fd9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(175, 82, 222, 0.4);
}

.btn-red:hover {
  background-color: #e0352b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 59, 48, 0.4);
}

/* สไตล์เมื่อปุ่มถูกเลือก */
.btn-blue.active {
  background-color: #0056b3;
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-purple.active {
  background-color: #8a2be2;
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-red.active {
  background-color: #c82333;
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Rainfall Legend Floating Box */
.waterlevel-legend-floating-box {
  position: fixed;
  right: 85px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  min-width: 100px;
}

@media (max-width: 600px) {
  .waterlevel-legend-floating-box {
    right: 260px;
    bottom: 20px;
  }
}

.waterlevel-legend-chart {
  background: #eee;
  border-radius: 12px;
  padding: 12px 18px 12px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  margin-bottom: 10px;
  display: block;
  min-width: 100px;
  width: 100%;
  max-width: 300px;
}

.waterlevel-legend-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.waterlevel-legend-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.waterlevel-legend-colorcell {
  min-width: 65px;
  height: 32px;
  border-radius: 4px;
  border: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 10px;
}

.waterlevel-legend-colorcell .wl-range {
  color: #fff;
  font-weight: normal;
  font-size: 0.60rem;
  white-space: nowrap;
  text-align: center;
  width: 100%;
  line-height: 1.1;
}

.waterlevel-legend-labelcell {
  font-size: 0.60rem;
  font-family: 'IBM Plex Sans Thai', Arial, sans-serif;
  color: #111;
  font-weight: 400;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.waterlevel-legend-labelcell .wl-range {
  font-weight: 600;
  margin-right: 8px;
}

.waterlevel-legend-labelcell .wl-desc {
  font-weight: 400;
}

.waterlevel-legend-toggle {
  background: #fff;
  font-size: 0.60rem;
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.13);
  padding: 8px 18px;
  font-family: 'IBM Plex Sans Thai', Arial, sans-serif;
  color: #111;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0;
  margin-bottom: 0;
  transition: background 0.2s;
  min-width: 160px;
  width: 100%;
}

.waterlevel-legend-toggle:active,
.waterlevel-legend-toggle:focus {
  background: #f2f2f2;
}

.rainfall-legend-floating-box {
  position: fixed;
  right: 260px;
  bottom: 20px;
}

@media (max-width: 600px) {
  .rainfall-legend-floating-box {
    left: 8px;
    right: auto;
    bottom: 20px;
  }
}

.rainfall-legend-floating-box {
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rainfall-legend-chart {
  background: #eee;
  border-radius: 12px;
  padding: 12px 18px 12px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  margin-bottom: 10px;
  display: block;
  min-width: 140px;
  max-width: 180px;
}

.rainfall-legend-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rainfall-legend-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.rainfall-legend-colorcell {
  width: 28px;
  height: 18px;
  border-radius: 3px;
  border: none;
  box-sizing: border-box;
}

.rainfall-legend-labelcell {
  font-size: 0.60rem;
  font-family: 'IBM Plex Sans Thai', Arial, sans-serif;
  color: #111;
  font-weight: 400;
  min-width: 36px;
}

.rainfall-legend-toggle {
  background: #fff;
  font-size: 0.60rem;
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.13);
  padding: 8px 18px;
  font-family: 'IBM Plex Sans Thai', Arial, sans-serif;
  color: #111;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0;
  margin-bottom: 0;
  transition: background 0.2s;
}

.rainfall-legend-toggle:active,
.rainfall-legend-toggle:focus {
  background: #f2f2f2;
}

.legend-toggle-label {
  font-size: 0.75rem;
  font-family: 'IBM Plex Sans Thai', Arial, sans-serif;
}

/* ====== Info Window ====== */
.info-window {
  position: relative;
}

/* ปุ่มปิด InfoWindow แบบกำหนดเอง */
.custom-info-window-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.custom-info-window-close:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.custom-info-window-close i {
  color: #333;
  font-size: 16px;
}

.info-window-image {
  position: relative;
}

/* ปรับแต่งขนาดของรูปภาพใน info window */
.info-window-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Custom Google Maps controls */
.map-controls {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  pointer-events: none;
}

.map-buttons-container {
  pointer-events: auto;
  background: none;
  border-radius: 16px;
  box-shadow: none;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0;
  align-items: flex-end;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0;
  position: relative;
  align-items: flex-end;
}

.map-type-selector-google {
  display: flex;
  flex-direction: row;
  gap: 10px;
  background: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: none;
  border: none;
  pointer-events: auto;
}

.map-buttons-container,
.map-type-selector-google {
  transition: box-shadow 0.2s, transform 0.2s;
}

.map-controls .btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 0;
  transition: box-shadow 0.2s, background 0.2s, border 0.2s;
  pointer-events: auto;
}

.map-controls .btn:hover,
.map-controls .btn:focus {
  background: #f1f3f6;
  border-color: #bdbdbd;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

.map-controls .btn:active {
  background: #e3e6eb;
  border-color: #9e9e9e;
}

.map-type-selector-google .btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.2s, background 0.2s, border 0.2s;
}

.map-type-selector-google .btn.active,
.map-type-selector-google .btn:focus {
  background: #e3f2fd;
  border-color: #2196f3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.12);
}

.map-type-selector-google .btn:hover {
  background: #f1f3f6;
  border-color: #90caf9;
}

.map-type-selector-google img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
}

.map-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.map-type-selector-google {
  display: flex;
  flex-direction: row;
  gap: 6px;

}

.map-type-selector-google .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 4px;
  transition: all 0.2s;
  overflow: hidden;
}

.map-type-selector-google .btn:hover {
  background: #f5f5f5;
  border-color: #dadce0;
}

.map-type-selector-google .btn.active {
  background: #e8f0fe;
  border-color: #d2e3fc;
  color: #1967d2;
}

.map-type-selector-google .btn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

/* ====== Map Controls ====== */

/* Map Type Drawer Styles */
.map-type-drawer {
  position: absolute;
  right: 0;
  bottom: 56px;
  min-width: 220px;
  background: #fff;
  border-radius: 14px 14px 16px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.23s cubic-bezier(.4, 0, .2, 1), transform 0.23s cubic-bezier(.4, 0, .2, 1);
  z-index: 10;
  padding: 0 0 10px 0;
}

.map-type-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.map-type-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px 8px 18px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  font-size: 15px;
  color: #1a9a9a;
}

.map-type-drawer .close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #888;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.map-type-drawer .close-btn:hover {
  background: #f7f7f7;
}

.map-type-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 0 12px;
}

.map-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  color: #222;
  cursor: pointer;
  transition: background 0.18s;
}

.map-type-option:hover,
.map-type-option.active {
  background: #e3f2fd;
  color: #1a9a9a;
}

.map-type-option img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .map-type-drawer {
    min-width: 170px;
    right: 0;
    left: auto;
    bottom: 48px;
    border-radius: 12px 12px 14px 14px;
  }

  .map-type-drawer-header {
    font-size: 14px;
    padding: 10px 12px 8px 12px;
  }

  .map-type-option {
    font-size: 14px;
    padding: 7px 8px;
  }
}

.info-window-close {
  position: absolute;
  top: -5px;
  right: 12px;
  /* background: rgba(0, 0, 0, 0.5);
    border: none; */
  color: white;
  width: 28px;
  height: 28px;
  /* border-radius: 50%; */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  z-index: 10;
  /* transition: all 0.2s ease; */
}

.info-window-close:hover {
  /* background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1); */
  color: #000;
}

.map-controls {
  position: absolute;
  bottom: 20px;
  right: 10px;
  z-index: 1000;
  display: flex;
}

.map-controls .btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  margin-bottom: 5px;
  padding: 0;
}

.map-controls .btn:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.map-controls .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.map-controls .btn i {
  font-size: 16px;
  color: #333;
}

/* ====== Custom InfoWindow ====== */
.gm-style .gm-style-iw {
  padding: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  overflow: hidden !important;
  max-width: 300px !important;
  border: none !important;
}

/* Remove the pointer/bubble */
.gm-style .gm-style-iw-t::after {
  display: none !important;
}

/* Remove the border */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

/* Remove the close button container */
.gm-ui-hover-effect {
  display: none !important;
}

.info-window {
  width: 100%;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  padding: 0 16px 20px 16px;
  box-sizing: border-box;
}

/* Image container */
.info-window-image {
  /* width: calc(100% + 32px);
    margin: 0 -16px 12px -16px; */
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

/* Image styling */
.info-window-img {
  width: 100%;
  /* height: 120px; */
  object-fit: cover;
  display: block;
}

.info-window-header {
  background-color: #1a9a9a;
  color: white;
  padding: 12px 15px;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-window-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.info-window-body {
  padding: 15px;
  background: white;
}

/* Image row */
.info-window-image {
  position: relative;
  width: 100%;
  /* height: 120px; */
  background-color: #f5f5f5;
  background-size: cover;
  background-position: center;
  margin-bottom: 12px;
  border-radius: 8px 8px 0 0;
}

/* Status row */
.info-window-status {
  display: flex;
  margin-bottom: 12px;
}

.status-indicator {
  font-size: 14px;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 0 0 80px;
  padding: 6px 8px;
  border-radius: 4px;
  text-align: center;
  color: white;
  margin-right: 10px;
}

.status-indicator div {
  line-height: 1.1;
}

.status-normal {
  background-color: #28a745;
}

.status-warning {
  background-color: #ffc107;
}

.status-critical {
  background-color: #dc3545;
}

.status-rainy {
  background-color: #02C4F6;
}

.status-nosignal {
  background-color: #6c757d;
}

.status-gray {
  background-color: #6c757d;
}

.station-info {
  line-height: 22px;
  flex: 1;
}

.station-info div {
  line-height: 1.1;
}


.station-number {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 2px;
}

.station-location {
  font-size: 12px;
  color: #666;
}

/* Data table */
.data-table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
}

.data-table td {
  padding: 6px 8px;
  text-align: center;
  border: 1px solid #eee;
  font-size: 12px;
}

.data-value {
  /* font-size: 16px; */
  font-size: 14px;
  font-weight: bold;
  display: block;
  margin-top: 2px;
}

.text-success {
  color: #28a745;
}

.text-warning {
  color: #ffc107;
}

.text-danger {
  color: #dc3545;
}

/* Footer */
.info-window-footer {
  /* display: flex;
    justify-content: space-between;
    align-items: flex-start; */
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
  font-size: 11px;
  color: #6c757d;
}

.footer-left {
  flex: 1;
  padding-right: 10px;
}

.footer-label {
  font-weight: 600;
  margin-bottom: 2px;
  color: #343a40;
}

.footer-updated {
  font-size: 10px;
  color: #6c757d;
}

.footer-right {
  flex-shrink: 0;
}

.footer-left {
  flex: 1;
  padding-right: 10px;
}

.footer-label {
  font-weight: 600;
  margin-bottom: 2px;
  color: #343a40;
}

.footer-updated {
  font-size: 10px;
  color: #6c757d;
}

.footer-right {
  flex-shrink: 0;
}

.graph-button {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.graph-button-dark {
  background: #343a40;
  color: #fff;
  border: 1px solid #343a40;
}

.graph-button-dark:hover {
  background: #23272b;
  border-color: #23272b;
  color: #fff;
}

.graph-button:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.graph-button i {
  margin-right: 6px;
  color: #6c757d;
}

/* ====== Map Container ====== */
#map-container {
  height: 100vh;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#map {
  height: 100%;
  width: 100%;
}

/* ====== Hide Google Maps Controls ====== */
.gm-bundled-control,
.gm-style-mtc,
.gm-svpc,
.gm-ui-hover-effect,
.gm-control-active,
.gmnoprint {
  display: none !important;
}

/* ====== Custom Map Controls ====== */
.custom-map-controls {
  position: fixed;
  right: 10px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: auto;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 5px;
  align-items: flex-end;
}

.zoom-controls {
  padding: 5px;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.control-btn:hover {
  background: #f0f0f0;
}

.control-btn i {
  font-size: 16px;
  color: #666;
}

.control-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.control-btn:hover {
  background: #f8f9fa;
}

.control-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Map Type Control Button */
.map-type-control {
  width: 60px;
  height: 60px;
  border: none;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.map-type-control:hover {
  transform: scale(1.05);
}

.map-type-control img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.map-type-control span {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  font-size: 11px;
  color: white;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);

  padding: 15px 4px 4px;
  border-radius: 0 0 8px 8px;
}

/* Map Type Selector */
.map-type-selector {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: white;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.map-type-selector.active {
  opacity: 1;
  visibility: visible;
}

.map-type-option {
  border: none;
  background: white;
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.2s;
  min-width: 60px;
}

.map-type-option:hover {
  background: #f8f9fa;
}

.map-type-option.active {
  background: #e8f0fe;
}

.map-type-option img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 3px;
}

.map-type-option span {
  font-size: 11px;
  color: #333;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .map-type-selector {
    bottom: 10px;
    padding: 8px;
    gap: 8px;
  }

  .map-type-option {
    min-width: 60px;
    padding: 6px;
  }

  .map-type-option img {
    width: 36px;
    height: 36px;
  }

  .map-type-option span {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .map-type-drawer {
    width: 240px;
  }

  .control-btn {
    width: 36px;
    height: 36px;
  }

  .control-btn i {
    font-size: 14px;
  }

  .map-type-btn img {
    width: 20px;
    height: 20px;
  }
}



.map-type-selector-google.map-type-btn-rect:active,
.map-type-selector-google.map-type-btn-rect:focus {
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.13);
  border-color: #2196f3;
}

.map-type-selector-google.map-type-btn-rect img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Drawer ปรับเป็นขวาล่าง */
.map-type-drawer {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 260px;
  max-width: 90vw;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  border-radius: 16px 16px 0 0;
  z-index: 1200;
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  opacity: 0;
}

.map-type-drawer.active {
  transform: translateY(0);
  pointer-events: auto;
  opacity: 1;
}

@media (max-width: 600px) {
  .map-type-drawer {
    width: 90vw;
    min-width: 180px;
    right: 5vw;
    bottom: 80px;
  }

  .map-type-selector-google.map-type-btn-rect {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
  }

  .map-type-selector-google.map-type-btn-rect img {
    width: 28px;
    height: 28px;
  }
}

/* ====== Responsive ====== */
@media (max-width: 991.98px) {
  .station-buttons {
    flex-wrap: wrap;
  }

  .station-buttons .btn {
    font-size: 12px;
    padding: 4px 8px;
  }
}

@media (max-width: 767.98px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.active {
    transform: translateX(0);
  }

  #sidebar-overlay.active {
    display: block;
  }

  #main-content {
    margin-left: 0;
  }

  .top-menu-bar .row>div {
    margin-bottom: 10px;
  }

  .station-buttons {
    justify-content: center;
  }
}

.graph-button-right {
  margin-right: 0;
  margin-left: auto;
  display: block;
}

.warning-box-summary {
  margin-top: 6px;
  margin-bottom: 4px;
}

.warning-box-summary-item {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  /* ขอบมน */
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.warning-box-summary-inline {
  display: flex;
  gap: 8px;
  /* หรือ 12px ตามที่ต้องการ */
  justify-content: space-between;
}

.warning-summary-status-1 {
  /* เฝ้าระวัง */
  background-color: #029900;
  color: #fff;
}

.warning-summary-status-2 {
  /* เตรียมพร้อม */
  background-color: #CC9903;
  color: #fff;
}

.warning-summary-status-3 {
  /* วิกฤติ */
  background-color: #FF0000;
  color: #fff;
}

.warning-box-summary-item .warning-box-summary-item-title {
  display: block;
  margin-bottom: 1px;
  font-size: 14px;
}

@media (max-width: 991.98px) {
  .search-sidebar {
    top: 58px;
  }
}
@media (max-width: 767.98px) {
  .search-sidebar {
    top: 56px;
  }
}