/* =========================================================
   1. ANIMATION & SUB-MENU DROPDOWN (DESKTOP)
   ========================================================= */
.wsmenu > .wsmenu-list > li > ul.sub-menu {
  opacity: 0;
  visibility: hidden;
  transform-style: preserve-3d;
  transform: rotateX(-75deg);
  transform-origin: 0% 0%;
  transition: transform 0.3s, opacity 0.3s;
}

.wsmenu > .wsmenu-list > li:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: rotateX(0deg);
}

.wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu {
  opacity: 0;
  visibility: hidden;
  transform-style: preserve-3d;
  transform: rotateX(-75deg);
  transform-origin: 0% 0%;
}

.wsmenu > .wsmenu-list > li > ul.sub-menu > li:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: rotateX(0deg);
  transition: transform 0.4s, opacity 0.4s;
}

.wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu > li > ul.sub-menu {
  opacity: 0;
  visibility: hidden;
  transform-style: preserve-3d;
  transform: rotateX(-75deg);
  transform-origin: 0% 0%;
  transition: transform 0.4s, opacity 0.4s;
}

.wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu > li:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: rotateX(0deg);
}

.wsmenu > .wsmenu-list > li > .wsmegamenu {
  opacity: 0;
  visibility: hidden;
  transform-style: preserve-3d;
  transform: rotateX(-75deg);
  transform-origin: 0% 0%;
  transition: transform 0.3s, opacity 0.3s;
}

.wsmenu > .wsmenu-list > li:hover > .wsmegamenu {
  opacity: 1;
  visibility: visible;
  transform: rotateX(0deg);
}

/* =========================================================
   2. RESET & BASE LAYOUT
   ========================================================= */
.wsmenu html, .wsmenu body, .wsmenu iframe, .wsmenu h1, .wsmenu h2, .wsmenu h3, .wsmenu h4, .wsmenu h5, .wsmenu h6 {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
  font-weight: normal;
  font-size: 12px;
  line-height: 18px;
  font-family: Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

.wsmenu .cl {
  clear: both;
}

.wsmenu img, object, embed, video {
  border: 0 none;
  max-width: 100%;
}

.wsmenu a:focus {
  outline: none;
}

.wsmenu:before, .wsmenu:after {
  content: "";
  display: table;
}

.wsmenu:after {
  clear: both;
}

.wsmainfull {
  width: 100%;
}

.wsmainwp {
  margin: 0 auto;
  max-width: 1400px;
  position: relative;
  background: #0d5a3b;
}

.desktoplogo {
  padding: 16px 0px 0px 0px;
  margin: 0;
  float: left;
}

.desktoplogo img {
  width: 100%;
}

.wsmenu {
  font-family: Helvetica, sans-serif;
  color: #fff;
  font-size: 14px;
  padding: 0;
  float: left;
  display: block;
  position: relative;
  z-index: 9999;
  width: 100%;
}

/* =========================================================
   3. MODERN DESKTOP MENU DESIGN & SPACING
   ========================================================= */
.wsmenu > .wsmenu-list {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  width: 100%;
  height: 62px;
  margin: 0 !important;
  padding: 3px 6px !important;
  box-sizing: border-box;
  background: #176d45;
  list-style: none;
  gap: 6px !important;
  overflow: hidden !important;
}

.wsmenu > .wsmenu-list > li {
  position: relative;
  float: none !important;
  display: flex !important;
  align-items: stretch;
  height: 55px;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* Phân bổ tỷ lệ độ rộng và min-width tối ưu theo độ dài chữ */
.wsmenu > .wsmenu-list > li:nth-child(1) { flex: 1 1 auto; min-width: 95px; }  /* Trang chủ */
.wsmenu > .wsmenu-list > li:nth-child(2) { flex: 1 1 auto; min-width: 105px; } /* Giới thiệu */
.wsmenu > .wsmenu-list > li:nth-child(3) { flex: 1 1 auto; min-width: 90px; }  /* Tin tức */
.wsmenu > .wsmenu-list > li:nth-child(4) { flex: 1 1 auto; min-width: 100px; } /* Tài liệu */
.wsmenu > .wsmenu-list > li:nth-child(5) { flex: 1 1 auto; min-width: 100px; } /* Văn bản */
.wsmenu > .wsmenu-list > li:nth-child(6) { flex: 1.5 1 auto; min-width: 155px; } /* Công khai giáo dục */
.wsmenu > .wsmenu-list > li:nth-child(7) { flex: 1.2 1 auto; min-width: 130px; } /* Lịch công tác */
.wsmenu > .wsmenu-list > li:nth-child(8) { flex: 1.5 1 auto; min-width: 155px; } /* Danh sách cán bộ */
.wsmenu > .wsmenu-list > li:nth-child(9) { flex: 1 1 auto; min-width: 95px; }  /* Liên hệ */

.wsmenu > .wsmenu-list > li > a {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 55px;
  min-width: 0;
  padding: 0 10px !important;
  margin: 0 !important;
  box-sizing: border-box;
  border: none !important;
  border-radius: 28px 28px 28px 0;
  color: #fff !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(12px, 0.85vw, 14px) !important;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.2px;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Màu sắc từng mục menu */
.wsmenu > .wsmenu-list > li:nth-child(1) > a { background: #42a7e8; }
.wsmenu > .wsmenu-list > li:nth-child(2) > a { background: #4dc65c; }
.wsmenu > .wsmenu-list > li:nth-child(3) > a { background: #ed0505; }
.wsmenu > .wsmenu-list > li:nth-child(4) > a { background: #7654e8; }
.wsmenu > .wsmenu-list > li:nth-child(5) > a { background: #18c39a; }
.wsmenu > .wsmenu-list > li:nth-child(6) > a { background: #ffad4c; }
.wsmenu > .wsmenu-list > li:nth-child(7) > a { background: #3298e5; }
.wsmenu > .wsmenu-list > li:nth-child(8) > a { background: #ffd21e; color: #333 !important; }
.wsmenu > .wsmenu-list > li:nth-child(9) > a { background: #59d8bc; }

.wsmenu > .wsmenu-list > li:first-child > a {
  border-radius: 28px 0 28px 0;
}

.wsmenu > .wsmenu-list > li > a:hover {
  filter: brightness(1.06);
}

/* Submenu Desktop */
.wsmenu > .wsmenu-list > li > ul.sub-menu {
  position: absolute !important;
  top: calc(100% + 4px);
  left: 0;
  z-index: 99999;
  display: none;
  min-width: 220px;
  padding: 7px !important;
  margin: 0 !important;
  background: #fff;
  border: none !important;
  border-radius: 0 14px 14px 14px;
  box-shadow: 0 8px 25px rgba(0,0,0,.15);
  white-space: normal;
  box-sizing: border-box;
}

.wsmenu > .wsmenu-list > li:hover > ul.sub-menu {
  display: block !important;
  visibility: visible;
  opacity: 1;
}

.wsmenu > .wsmenu-list > li > ul.sub-menu > li > a {
  display: block;
  padding: 9px 13px;
  margin: 2px 0;
  border-radius: 8px;
  color: #555 !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  transition: all .2s ease;
}

.wsmenu > .wsmenu-list > li > ul.sub-menu > li > a:hover {
  padding-left: 18px;
  color: #fff !important;
  background: #4dc65c;
}

/* Extra Desktop Extras */
.wsmobileheader {
  display: none;
}

.overlapblackbg {
  opacity: 0;
  visibility: hidden;
}

.wsmenu .wsmenu-click, .wsmenu .wsmenu-click02, .hometext {
  display: none;
}

/* =========================================================
   4. MOBILE RESPONSIVE & FIX KHOẢNG TRẮNG / NÚT MENU
   ========================================================= */
@media only screen and (max-width: 991px) {
  html {
    overflow: hidden;
    height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  body {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body.wsactive {
    overflow: hidden;
  }

  .desktoplogo {
    display: none;
  }

  .wsmainfull {
    height: 0 !important;
  }

  /* Khắc phục triệt để khoảng trắng phía trên trên di động */
  .wsmenucontainer {
    margin-top: 0 !important;
    padding-top: 50px !important;
  }

  /* Thanh Header Mobile cố định */
  .wsmobileheader {
    width: 100%;
    height: 50px;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10002;
    background-color: #08519c;
    text-align: center;
    box-shadow: 0 0 1px rgba(0, 0, 0, .3);
    transition: all 0.25s ease-in-out;
  }

  .wsactive .wsmobileheader {
    margin-left: 240px;
  }

  /* Nút Menu Toggle (3 gạch) căn chỉnh chuẩn, không bị cắt viền */
  .wsanimated-arrow {
    position: absolute !important;
    left: 10px !important;
    top: 50% !important;
    transform: translateY(-50%);
    z-index: 102;
    cursor: pointer;
    padding: 10px;
    margin: 0 !important;
    display: block;
  }

  .wsanimated-arrow span,
  .wsanimated-arrow span:before,
  .wsanimated-arrow span:after {
    cursor: pointer;
    height: 2px;
    width: 17px;
    background: #fff;
    position: absolute;
    display: block;
    content: '';
    transition: all 500ms ease-in-out;
  }

  .wsanimated-arrow span:before {
    top: -7px;
    width: 23px;
  }

  .wsanimated-arrow span:after {
    bottom: -7px;
    width: 17px;
  }

  .wsactive .wsanimated-arrow span:after {
    width: 23px;
    transform: rotate(-45deg);
    bottom: 0px;
  }

  .wsactive .wsanimated-arrow span {
    background-color: transparent;
  }

  .wsactive .wsanimated-arrow span:before {
    top: 0px;
    transform: rotate(45deg);
  }

  /* Menu Drawer Mobile */
  .wsmenu {
    width: 100%;
    background: transparent;
    left: 0;
    overflow-y: hidden;
    padding: 0;
    top: 0;
    visibility: hidden;
    position: fixed;
    margin: 0px;
  }

  .wsmenu>.wsmenu-list {
    height: auto !important;
    min-height: 100%;
    width: 240px;
    background: #fff;
    padding-bottom: 0;
    margin-left: -240px;
    display: block !important;
    text-align: center;
    transition: all 0.25s ease-in-out;
  }

  .wsmenu>.wsmenu-list>li {
    width: 100%;
    display: block !important;
    float: none;
    height: auto;
  }

  .wsmenu>.wsmenu-list>li>a {
    padding: 8px 32px 8px 10px;
    font-size: 14px;
    text-align: left;
    background-color: transparent;
    color: #666666 !important;
    line-height: 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.13);
    height: auto;
    width: auto;
    border-radius: 0;
  }

  .wsactive .wsmenu {
    overflow-y: scroll;
    visibility: visible;
    z-index: 1000;
    top: 0;
  }

  .wsactive .wsmenu>.wsmenu-list {
    margin-left: 0;
  }

  .overlapblackbg {
    right: 0;
    width: calc(100% - 240px);
    height: 100vh;
    position: fixed;
    top: 0;
    opacity: 0;
    visibility: hidden;
    background-color: rgba(0, 0, 0, 0.45);
  }

  .wsactive .wsmenu .overlapblackbg {
    opacity: 1;
    visibility: visible;
  }

  .wsactive .wsmenucontainer {
    margin-left: 240px;
  }
}