/* ===============================
   THEME VARIABLES
================================ */
:root {
  --primary: #1a4a2e;
  --accent: #f39c12;
  --dark: #0b1c2d;
  --dark-soft: #102a43;
  --light: #f4f7f6;
  --white: #ffffff;
  --grey: #cbd5e1;
  --header-grad: linear-gradient(180deg, #ffffff 0%, #e8f5e9 100%);
  --header-height: 110px;
}

@media (max-width: 992px) {
  :root {
    --header-height: 160px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 300px;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 320px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--light);
  padding-top: var(--header-height);
}

/* ===============================
   HEADER (RESPONSIVE)
================================ */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--header-grad);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 6px 3%;
}

/* Top row */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Center title */
.header-content {
  text-align: center;
  flex: 1;
  min-width: 220px;
}

.header-content h1 {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--primary);
}

.header-content p {
  margin: 2px 0;
  font-weight: 600;
  font-size: clamp(0.75rem, 2vw, 0.95rem);
}

/* Logos */
.logo-img,
.tg-police-img,
.tg-logo-img {
  height: auto;
  border-radius: 50%;
}

.logo-img {
  width: clamp(60px, 10vw, 90px);
}

.tg-logo-img {
  width: clamp(65px, 10vw, 100px);
}

.tg-police-img {
  width: clamp(60px, 10vw, 90px);
}

/* ===============================
   NAVIGATION
================================ */
.nav-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(26,74,46,0.15);
}

.nav-menu a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 6px;
  white-space: nowrap;
}

.nav-menu a:hover {
  color: var(--accent);
}

/* ===============================
   TABLET
================================ */
@media (max-width: 992px) {
  .header-top {
    justify-content: center;
  }

  .nav-menu {
    gap: 14px;
  }
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {
  header {
    padding: 8px 4%;
  }

  .header-top {
    flex-direction: column;
    text-align: center;
  }

  .header-content {
    order: 2;
  }

  .logo-img {
    order: 1;
  }

  .tg-logo-img,
  .tg-police-img {
    order: 3;
  }

  .nav-menu {
    gap: 10px;
    font-size: 0.8rem;
  }
}

/* ===============================
   SMALL MOBILE
================================ */
@media (max-width: 480px) {
  .nav-menu {
    gap: 8px;
  }

  .nav-menu a {
    font-size: 0.78rem;
  }
}

/* ===============================
   HERO SECTION
================================ */

.hero-banner {
  border-top: 4px solid var(--accent);
  background: linear-gradient(180deg, var(--dark-soft), #071421);
  color: var(--white);
  padding: 10px 5%;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

/* Profile Cards */
.hero-profile {
  text-align: center;
  width: 200px;
  flex-shrink: 0;
}

.hero-profile img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--accent);
}

.hero-profile p {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Vision Center */
.hero-vision {
  flex: 1;
  text-align: center;
  padding: 10px 20px;
}

.hero-vision h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-style: italic;
  margin-bottom: 8px;
}

.hero-vision p {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  opacity: 0.9;
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 768px) {

  .hero-banner {
    flex-direction: column;
    text-align: center;
  }

  /* Explicit mobile order */
  .cm { order: 1; }
  .dgp { order: 2; }
  .hero-vision { order: 3; margin: 15px 0; }
  .joint-cp { order: 4; }

  .hero-profile {
    width: 100%;
  }

  .hero-profile img {
    width: 140px;
    height: 140px;
  }
}

/* ===============================
   SECTIONS
================================ */
section {
  padding: 20px 8% 60px;
  scroll-margin-top: var(--header-height);
}

.district-section {
  min-height: 100vh;
}

h2 {
  text-align: center;
  color: var(--dark);
}

h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: var(--accent);
  margin: 5px auto 0;
  border-radius: 2px;
}

/* ================= WHAT WE DO SECTION ================= */
#whatwedo {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
    text-align: center;
}



.subtitle {
    max-width: 900px;
    margin: 0 auto 55px;
    font-size: 17px;
    color: #475569;
}


/* ===============================
   CARDS
================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 22px;
  margin-top: 30px;
}

.card {
  background: var(--white);
  border-radius: 14px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.icon {
    font-size: 40px;
    margin-bottom: 18px;
}

/* ===============================
   NEWS & EVENTS (IMAGE CARDS)
================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 35px;
}

.news-card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.14);
}

.news-img {
  height: 200px;
  background: #eee;
  overflow: hidden;
}

.news-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-body {
  padding: 22px;
}

.news-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.news-title {
  font-size: 1.15rem;
  color: var(--dark);
  margin: 0 0 10px;
}

.news-desc {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 768px) {
  .news-img {
    height: 180px;
  }
}



/* ===============================
   GALLERY – RESPONSIVE VIDEO
================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 30px;
}

/* Responsive video wrapper */
.video-box {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.video-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Mobile optimization */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}


/* ===============================
   CONTACT
================================ */
form {
  max-width: 520px;
  margin: auto;
  display: grid;
  gap: 15px;
}

input,
textarea {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 13px;
  border-radius: 8px;
  cursor: pointer;
}


/* ===============================
   CONTACT SECTION LAYOUT
================================ */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  margin-top: 30px;
}

/* Ensure form aligns left inside grid */
.contact-form {
  margin: 0;
}

/* Focus states (accessibility) */
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* Button hover */
button:hover {
  opacity: 0.9;
}

/* Map styling */
.contact-map {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 0;
}

.contact-block h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--dark);
}

.contact-address {
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  form {
  background: var(--white);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

  .contact-map iframe {
    min-height: 300px;
  }
}

/* ===============================
   FOOTER (ENHANCED)
================================ */
.aa-footer {
  background: #071421;
  color: var(--white);
  border-top: 3px solid var(--accent);
  padding: 30px 6% 15px;
  font-size: 0.85rem;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 30px;
  align-items: center;
}

/* Brand + Social */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-social a {
  color: var(--white);
  font-size: 1.3rem;
  margin-right: 12px;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--accent);
}

.footer-tagline {
  font-weight: 600;
  line-height: 1.4;
}

.footer-tagline span {
  color: var(--accent);
}

/* Links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
}

.footer-links a {
  color: var(--grey);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Message */
.footer-message {
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.4;
}

.footer-message strong {
  color: var(--accent);
}

/* Bottom line */
.footer-bottom {
  text-align: center;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.75rem;
  color: var(--grey);
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-message {
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}


/* ===== Contact Form Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top-color: #f39c12;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #fff;
  margin-top: 15px;
  font-size: 16px;
  letter-spacing: 0.5px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast Message ===== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 10000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #27ae60;
}

.toast.error {
  background: #e74c3c;
}


/* ===============================
   DROPDOWN (STRICT CLICK CONTROL)
================================ */
.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;

  min-width: 220px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(0,0,0,.15);
  border-radius: 6px;
  z-index: 3000;

  /* 🔒 HARD HIDE */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);

  transition: opacity 0.2s ease, transform 0.2s ease;
  max-height: 420px;
  overflow: hidden;

}

.dropdown-list {
  max-height: 350px;
  overflow-y: auto;
}

.dropdown-list a {
  display: block;
  padding: 8px 14px;
}

.dropdown-list a.active {
  background: #e63946;
  color: #fff;
}

/* Search box */
.dropdown-search {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 8px;
  border-bottom: 1px solid #eee;
  z-index: 1;
}

.dropdown-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.85rem;
}


.dropdown.open .dropdown-content {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--dark);
  text-decoration: none;
}

.dropdown-content a:hover {
  background: var(--light);
  color: var(--primary);
}


/* Active district highlight */
.dropdown-content a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* Scrollbar (optional, nice) */
.dropdown-content::-webkit-scrollbar {
  width: 6px;
}

.dropdown-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}


.district-wrapper {
  display: flex;
  gap: 30px;
  align-items: center;
  max-width: 1100px;
  margin: auto;
}

.district-wrapper img {
  width: 45%;
  border-radius: 10px;
}

.district-content {
  width: 55%;
  font-size: 17px;
  line-height: 1.6;
}

.district-header {
  position: sticky;
  top: calc(var(--header-height) + 10px);
  background: #ffffff;
  z-index: 900;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  margin-bottom: 25px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  /* margin: 20px 0;
  flex-wrap: wrap; */
}

.district-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.08), transparent);
}

.district-header h2 {
  margin: 0;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.date-filter input[type="date"] {
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.date-filter button {
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* All disabled / non-selectable dates */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.disabled,
.flatpickr-day.notAllowed,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #9a9a9a !important;
  opacity: 1 !important;
  background: transparent !important;
  pointer-events: none;
}

/* Dates WITH data */
.flatpickr-day.has-data {
  background: #0b5ed7 !important;
  color: #fff !important;
  border-radius: 50%;
  font-weight: 600;
}

/* Hover effect */
.flatpickr-day.has-data:hover {
  background: #084298 !important;
}

/* Selected date */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #198754 !important;
  color: #fff !important;
}

/* Today border */
.flatpickr-day.today {
  border: 1px solid #198754 !important;
}


.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1200px;
  margin: auto;
}

.program-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  overflow: hidden;
}

.program-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.program-card .content {
  padding: 15px;
}


.program-card .date {
  display: inline-block;
  background: #3498db;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.map-container {
  max-width: 800px;
  margin: auto;
}

.map-container svg path {
  cursor: pointer;
  fill: #e6e6e6;
  stroke: #555;
}

.map-container svg path:hover {
  fill: #f57c00;
}

/* ================= CAROUSEL ================= */

.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 220px;
  margin-bottom: 10px;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
  height: 100%;
}

.carousel-track img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
  z-index: 2;
}

.carousel .prev {
  left: 5px;
}

.carousel .next {
  right: 5px;
}

.carousel button:hover {
  background: rgba(0,0,0,0.8);
}

.single-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  margin-bottom: 10px;
}


/* ===============================
   SCROLL TO TOP (MODERN)
================================= */

#scrollTopBtn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 55px;
  height: 55px;
  border: none;
  border-radius: 50%;
  /* background: linear-gradient(135deg, #d32f2f, #b71c1c); */
  background: linear-gradient(135deg, #2fd33d, lab(36.82% -36.08 18.12));
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scrollTopBtn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 25px rgba(0,0,0,0.35);
}

/* Progress Ring */
.progress-ring {
  position: absolute;
  transform: rotate(-90deg);
}

.progress-ring__circle {
  stroke: #ffffff;
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  transition: stroke-dashoffset 0.2s linear;
}

/* Mobile Adjust */
@media (max-width: 768px) {
  #scrollTopBtn {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }
}


/* Lazy image fade-in */
.lazy-img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lazy-img.loaded {
  opacity: 1;
}

/* ===============================
   SKELETON LOADING CARDS
================================= */

.skeleton-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.skeleton-img {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 37%,
    #f0f0f0 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 37%,
    #f0f0f0 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-line.medium {
  width: 70%;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}


/* ===============================
   DESCRIPTION COLLAPSE
================================= */

.program-desc {
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.program-desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;  /* show 3 lines only */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  background: none;
  border: none;
  color: #d32f2f;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 5px;
}

.read-more-btn:hover {
  text-decoration: underline;
}

/* ================= IMAGE LOADER ================= */

  .image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    background: #f3f3f3;
    overflow: hidden;
  }

  .program-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .program-img.loaded {
    opacity: 1;
  }

  .img-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .img-loader::after {
    content: "";
    width: 35px;
    height: 35px;
    border: 4px solid #ddd;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }