@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');
:root {
  --primary-blue: #0265c7;
  --accent-sky: #38bdf8;
  --gradient-blue: linear-gradient(135deg, #0f4c81 0%, #0265c7 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f1f5f9;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: 1px solid rgba(255, 255, 255, 0.8);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px -5px rgba(2, 132, 199, 0.1);
  --radius-xl: 20px;
  --radius-md: 12px;
}
[data-theme="dark"] {
  --bg-page: #0f172a;
  --glass-bg: rgba(30, 41, 59, 0.95);
  --gradient-card: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  --text-dark: #e2e8f0;
  --text-muted: #94a3b8;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}
body {
  font-family: 'Kanit', sans-serif !important;
  background-color: var(--bg-page);
  background-image: radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.05) 0%, rgba(2, 101, 199, 0.05) 90%);
  color: var(--text-dark);
  line-height: 1.7;
  margin: 0;
  padding: 0;
}
#imageZoomModal .modal-body {
  background-color: #1a1a1a;
  overflow: hidden;
  position: relative;
  touch-action: none;
}
#zoomImage {
  transition: transform 0.1s ease-out;
  cursor: grab;
  max-width: none;
  max-height: none;
  touch-action: none;
  transform-origin: center center;
}
#zoomImage:active {
  cursor: grabbing;
}
.zoom-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 8px 15px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}
.zoom-controls span {
  font-family: 'Kanit', sans-serif;
  font-weight: bold;
  min-width: 45px;
  text-align: center;
  user-select: none;
  font-size: 14px;
  color: #000;
}
@media (max-width: 576px) {
  .zoom-controls {
    bottom: 20px;
    padding: 5px 10px;
    width: 95%;
    justify-content: center;
  }
}
.structure-page-container {
  padding-top: 140px;
  padding-bottom: 3rem;
  min-height: 100vh;
}
.structure-content-box {
  background: var(--glass-bg);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: var(--glass-border);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.structure-content-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--gradient-blue);
}
header {
  margin-bottom: 3rem;
}
.main-title-th {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: -0.5px;
}
.main-title-en {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  font-family: 'Kanit', sans-serif;
  letter-spacing: 0.5px;
  opacity: 0.8;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary-blue);
  margin: 2.5rem 0 1.5rem 0;
  padding-left: 1rem;
  border-left: 5px solid var(--accent-sky);
  position: relative;
}
.overview-section {
  background: linear-gradient(to right, rgba(56, 189, 248, 0.1), rgba(255, 255, 255, 0));
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
}
.intro-text {
  font-size: 1.1rem;
  text-align: justify;
  color: var(--text-dark);
  margin: 0;
  text-indent: 2em;
}
.mission-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.mission-list .list-group-item {
  background: var(--gradient-card);
  border: 1px solid rgba(2, 132, 199, 0.1);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  font-weight: 500;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}
.mission-list .list-group-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-sky);
}
.admin-structure .structure-item {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
  border: 1px solid #eef2f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: all 0.3s ease;
}
[data-theme="dark"] .admin-structure .structure-item {
  background: #1e293b;
  border-color: #334155;
}
.admin-structure .structure-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(2, 132, 199, 0.15);
}
.structure-item .number {
  background: var(--gradient-blue);
  color: white;
  font-size: 2rem;
  font-weight: 700;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 5px 15px rgba(2, 132, 199, 0.3);
}
.structure-item .label {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}
.gov-card {
  background: var(--glass-bg);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: transform 0.3s ease;
  overflow: hidden;
  height: 100%;
}
.gov-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-sky);
}
.gov-header {
  background: linear-gradient(to bottom right, #f8fafc, #fff);
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 1rem;
  [data-theme="dark"] & {
    background: #1e293b;
    border-color: #334155;
  }
}
.gov-icon {
  font-size: 2rem;
  background: #e0f2fe;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
}
.gov-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
}
.gov-count {
  display: inline-block;
  background: var(--primary-blue);
  color: white;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 5px;
}
.municipal-breakdown {
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  margin-top: 0;
}
.municipal-item {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px dashed #e2e8f0;
}
.municipal-item:last-child {
  border-bottom: none;
}
.municipal-number {
  color: var(--primary-blue);
  background: #f0f9ff;
  padding: 2px 10px;
  border-radius: 8px;
  font-weight: 700;
}
.image-container {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  text-align: center;
}
.zoom-trigger-wrapper {
  position: relative;
  display: inline-block;
  cursor: zoom-in;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid #fff;
  max-width: 100%;
}
.org-chart-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}
.zoom-trigger-wrapper:hover .org-chart-image {
  transform: scale(1.03);
}
.zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.zoom-trigger-wrapper:hover .zoom-overlay {
  opacity: 1;
}
.zoom-icon {
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(10px);
  transition: transform 0.3s ease;
}
.zoom-trigger-wrapper:hover .zoom-icon {
  transform: translateY(0);
}
.modal-backdrop.show {
  opacity: 0.8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(15, 23, 42, 0.8);
}
.download-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.download-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 18px 45px;
  font-family: 'Kanit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff !important;
  text-decoration: none;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
  background-size: 200% auto;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  z-index: 1;
}
.download-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: 0.6s;
  z-index: -1;
}
.download-btn:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.5), 0 0 20px rgba(14, 165, 233, 0.4);
  background-position: right center;
}
.download-btn:hover::after {
  left: 100%;
}
.download-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(2, 132, 199, 0.3);
}
.download-icon {
  font-size: 1.4rem;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}
@media (max-width: 768px) {
  .structure-page-container {
    padding-top: 100px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .structure-content-box {
    padding: 1.5rem;
  }
  .main-title-th {
    font-size: 1.8rem;
  }
  .mission-list {
    grid-template-columns: 1fr;
  }
  .download-btn {
    width: 100%;
    padding: 15px;
  }
}