body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: #ffffff;
  color: #2c3e50;
  /* background-image: url('https://www.greenyellow.vn/wp-content/uploads/2023/02/Reducing-our-personal-carbon-footprint.webp'); 
            background-size: cover; 
            background-position: center center; 
            background-attachment: fixed;  */

}

.content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px;
  gap: 20px;
  flex: 1;
  position: relative; /* เพิ่ม position relative */
  margin-left: 200px;
}

.map-header {
  /* text-align: center; */
  font-size: 18px;
  color: green;
  font-weight: bold;
  margin-top: 90px;
  margin-left: 220px;
}

#map {
  flex: 1;
  height: 550px;
  border: 1px solid #000000;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
#small-map {
  border: 1px solid #000000;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.cards-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* แบ่งเป็น 4 คอลัมน์ในแถวแรก */
  gap: 15px;

}

.card {
  background: rgba(255, 255, 255, 0.9);
  background: white;
  height: 210px;
  border: 1px solid #000000;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
  flex-direction: column;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.card .icon {
  font-size: 50px;
  margin-top: 15px;
}

.card h2 {
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 10px;
  color: #34495e;
  font-weight: normal;
}

.card h3 {
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 10px;
  color: #34495e;
  font-weight: bold;
}

.card p {
  color: #34495e;
  font-size: 18px;
  font-family: 'Poppins', sans-serif;
}

.cards-container b {
  color: #34495e;
  font-size: 18px;
}

.large-card {
  grid-column: span 2; /* ให้การ์ดนี้ครอบคลุม 2 คอลัมน์ */
  height: 325px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#carbonPieChart {
  width: 100% !important;
  height: 100% !important;
  max-width: 300px;
  max-height: 300px;
}

/* สไตล์สำหรับการ์ด Average Tree Data */
.average-tree-data-card {
  grid-column: span 2; /* ให้การ์ดนี้ครอบคลุม 2 คอลัมน์ */
  width: 100%; /* ความกว้างเต็มคอลัมน์ */
}

.average-tree-data-card .card {
  text-align: left; /* ชิดซ้าย */
  padding: 20px;
  height: 325px; /* กำหนดความสูง */
}

.average-tree-data-card .card p {
  font-size: 12px;
  margin: 10px 0; /* ปรับ margin ของข้อความ */
}

.average-tree-data-card .card b {
  font-size: 13px;
  margin: 10px 0; /* ปรับ margin ของข้อความ */
}


/* เพิ่มสไตล์สำหรับคลัสเตอร์ */
.marker-cluster-small {
    background-color: rgba(137, 223, 57, 0.6); /* เขียวอ่อน */
}
.marker-cluster-medium {
    background-color: rgba(102, 184, 55, 0.6); /* เขียวกลาง */
}
.marker-cluster-large {
    background-color: rgba(46, 131, 20, 0.6); /* เขียวเข้ม */
}

/* สไตล์สำหรับตัวเลขในคลัสเตอร์ */
.marker-cluster div {
    background-color: rgba(0, 0, 0, 0); /* สีพื้นหลังของตัวเลข */
    color: #000000; /* สีตัวเลข */
    font-weight: normal;
    font-size: 12px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
    /* Import Google font - Poppins */
    @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: "Poppins", sans-serif;
    }
    :root {
      --white-color: #fff;
      --blue-color: #4070f4;
      --grey-color: #707070;
      --grey-color-light: #aaa;
    }
    body.dark {
      background-color: #333;
      color: #fff;
    }
    body.dark .navbar {
      background-color: #222;
      color: #fff;
    }
    body.dark .sidebar {
      background-color: #222;
      color: #fff;
    }
    body.dark .site-details {
      background-color: #444;
      color: #fff;
    }
/* Header */
.header {
position: fixed;
top: 0;
width: 100%;
height: 80px;
left: 0;
background-color: var(--white-color);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0px; /* เอา padding ออก */
z-index: 8000;
box-shadow: 0 0 2px var(--grey-color-light);
}

/* โลโก้ชิดซ้ายสุด */
.header_left {
display: flex;
align-items: center;
flex-shrink: 0;
margin-right: 20px;
}

/* โลโก้และชื่อแอป */
.logo_item {
display: flex;
align-items: center;
column-gap: 10px;
font-size: 22px;
font-weight: 500;
color: var(--blue-color);
}

/* จัด text-content ให้ชิดซ้ายตามโลโก้ */
.text-content {
flex-grow: 1;
text-align: left;
}

.text-content h1 {
color: green;
font-size: 24px;
font-weight: bold;
}

.text-content p {
font-size: 14px;
color: #555;
line-height: 1.5;
}

.logo {
width: 90px;
height: auto;
margin-left: 0; /* เอา margin ออก */
}

/* ปุ่ม Login */
.header_content {
display: flex;
align-items: center;
column-gap: 15px;
}

.login_button {
background-color: transparent;
color: #333;
padding: 5px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 15px;
display: flex;
align-items: center;
gap: 5px;
}

.login_button:hover {
background-color: #3333333e;
}

.login_button i {
font-size: 20px;
}

@media (max-width: 768px) {
.header {
  display: flex;
  flex-direction: column; /* บังคับให้เรียงเป็นแนวตั้ง */
  align-items: center; /* จัดให้อยู่ตรงกลาง */
  justify-content: center;
  height: auto;
  padding: 10px;
  text-align: center;
}

.header_left {
  position: absolute;
  left: 10px; /* ดันไปซ้ายสุด */
  top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 80px; /* ปรับขนาดโลโก้ให้พอดี */
  height: auto;
}

.text-content {
  font-size: 12px;
  max-width: 100%;
  padding: 5px 10px;
}

.header_content {
  width: 100%;
  display: flex;
  justify-content: center; /* ปุ่ม Login อยู่ตรงกลาง */
  margin-top: 10px;
}

.login_button {
  width: auto;
}
}



    /* sidebar */
    .sidebar {
      background-color: var(--white-color); 
      width: 200px;
      position:fixed;
      top: 0;
      left: 0;
      height: 100%;
      padding: 80px 20px;
      z-index: 100;
      overflow-y: scroll;
      /* box-shadow: 0 0 1px var(--grey-color-light); */
      transition: all 0.5s ease;
    }
    /* ปุ่ม ☰ */
#sidebarOpen {
display: none; /* ซ่อนปุ่มบนคอมพิวเตอร์ */
}
    .sidebar.close {
      padding: 60px 0;
      width: 80px;
    }
    .sidebar::-webkit-scrollbar {
      display: none;
    }
    .menu_content {
      position: relative;
    }
    .menu_title {
      margin: 15px 0;
      padding: 0 20px;
      font-size: 18px;
    }
    .sidebar.close .menu_title {
      padding: 6px 30px;
    }
    .menu_title::before {
      color: var(--grey-color);
      white-space: nowrap;
    }
    .menu_dahsboard::before {
      content: "Dashboard";
    }
    .menu_editor::before {
      content: "Editor";
    }
    .menu_setting::before {
      content: "Setting";
    }
    .sidebar.close .menu_title::before {
      content: "";
      position: absolute;
      height: 2px;
      width: 18px;
      border-radius: 12px;
      background: var(--grey-color-light);
    }
    .menu_items {
      padding: 0;
      list-style: none;
    }

    .navlink_icon {
      position: relative;
      font-size: 22px;
      min-width: 50px;
      line-height: 40px;
      display: inline-block;
      text-align: center;
      border-radius: 6px;
    }
    .navlink_icon::before {
      content: "";
      position: absolute;
      height: 100%;
      width: calc(100% + 100px);
      left: -20px;
    }
    .navlink_icon:hover {
      background: var(--blue-color);
    }
    .sidebar .nav_link {
      display: flex;
      align-items: center;
      width: 100%;
      padding: 4px 15px;
      border-radius: 8px;
      text-decoration: none;
      color: var(--grey-color);
      white-space: nowrap;
    }
    .sidebar.close .navlink {
      display: none;
    }
    .nav_link:hover {
      color: var(--white-color);
      background: var(--blue-color);
    }
    .sidebar.close .nav_link:hover {
      background: var(--white-color);
    }
    .submenu_item {
      cursor: pointer;
    }
    .submenu {
      display: none;
      background-color: var(--white-color);
      padding-left: 20px;
      z-index: 1002; /* ให้ submenu อยู่เหนือ sidebar */
    }
    .submenu_item .arrow-left {
      position: absolute;
      right: 10px;
      display: inline-block;
      margin-right: auto;
    }
    .sidebar.close .submenu {
      display: none;
    }
    .show_submenu ~ .submenu {
      display: block;
    }
    .show_submenu .arrow-left {
      transform: rotate(90deg);
    }
    .submenu .sublink {
      padding: 15px 15px 15px 52px;
    }
    .bottom_content {
      position: fixed;
      bottom: 60px;
      left: 0;
      width: 260px;
      cursor: pointer;
      transition: all 0.5s ease;
    }
    .bottom {
      position: absolute;
      display: flex;
      align-items: center;
      left: 0;
      justify-content: space-around;
      padding: 18px 0;
      text-align: center;
      width: 100%;
      color: var(--grey-color);
      border-top: 1px solid var(--grey-color-light);
      background-color: var(--white-color);
    }
    .bottom i {
      font-size: 20px;
    }
    .bottom span {
      font-size: 18px;
    }
    .sidebar.close .bottom_content {
      width: 50px;
      left: 15px;
    }
    .sidebar.close .bottom span {
      display: none;
    }
    .sidebar.hoverable .collapse_sidebar {
      display: none;
    }

    /* ปรับให้การ์ดแสดง 2 คอลัมน์ในมือถือ */
@media (max-width: 768px) {
  .content {
    flex-direction: column;
    align-items: center;
    margin-left: 0 !important;
    padding: 1rem;
    width: 100%;
  }

  .map-header {
    margin-top: 280px;
    align-items: center;

  }

  .sidebar {
    left: -100%;
    width: 50%;
    z-index: 9998;
    padding: 10px 10px;

  }

  .sidebar.show {
    left: 0;
  }

  #sidebarOpen {
    display: block; /* แสดงปุ่มบนมือถือ */
    z-index: 9999; /* ให้ปุ่มอยู่เหนือ sidebar */
  }

  #map {
      width: 100%;
      height: 450px;
      min-height: 300px; /* ป้องกัน map หาย */
      border: 1px solid #000000;
      border-radius: 10px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    

  .cards-container {
    grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ในมือถือ */
  }
}

      /* ปรับให้การ์ดแสดง 2 คอลัมน์ในมือถือ */
@media (max-width: 480px) {
.content {
  flex-direction: column;
  align-items: center;
  margin-left: 0 !important;
  margin-top: 300px!important;
  padding: 1rem;
  width: 100%;
  margin: 180px;
}

.sidebar {
  left: -100%;
  width: 50%;
  z-index: 9998;
  padding: 10px 10px;

}

.sidebar.show {
  left: 0;
}

#sidebarOpen {
  display: block; /* แสดงปุ่มบนมือถือ */
  z-index: 9999; /* ให้ปุ่มอยู่เหนือ sidebar */
}

#map {
    width: 100%;
    height: 450px;
    min-height: 300px; /* ป้องกัน map หาย */
    border: 1px solid #000000;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }

.cards-container {
  grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ในมือถือ */
}

.card {
  width: 100%;
}
}

/* สไตล์ของการ์ด */
.card {
background: white;
height: 210px;
border: 1px solid #000000;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 15px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.card h2, .card h3, .card p {
font-family: 'Poppins', sans-serif;
color: #34495e;
}

/* ปรับ Large Card ให้เหมาะกับมือถือ */
.large-card {
grid-column: span 2; /* ครอบคลุม 2 คอลัมน์ */
height: 325px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}


