/* TownGov Gallery & Custom Home Styles (externalized from home.php) */

/* Gallery Slider Navigation & Dots */
.gallery-slider .owl-nav button {
  width: 50px;
  height: 50px;
  background: var(--thm-primary) !important;
  color: #fff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(45, 205, 124, 0.3);
  pointer-events: all;
  border: none !important;
  background-image: none !important;
}
.gallery-slider .owl-nav button:hover {
  background: var(--thm-black) !important;
  color: #fff !important;
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(30, 41, 59, 0.25);
}
.gallery-slider .owl-nav button i {
  color: #fff !important;
}
.gallery-slider .owl-dot {
  width: 12px;
  height: 12px;
  background: #cbd5e1 !important;
  border-radius: 50%;
  margin: 0 5px;
  display: inline-block;
  transition: all 0.3s ease;
  border: none !important;
}
.gallery-slider .owl-dot.active {
  width: 30px;
  border-radius: 6px;
  background: var(--thm-primary) !important;
  background-image: none !important;
}

/* Galeri Foto Button */
.gallery-section .btn-primary {
  background: var(--thm-primary) !important;
  background-color: var(--thm-primary) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}
.gallery-section .btn-primary:hover, .gallery-section .btn-primary:focus {
  background: var(--thm-black) !important;
  background-color: var(--thm-black) !important;
  color: #fff !important;
}

/* Stats Counter Section */
.stats-section {
  background: var(--thm-primary);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
.stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  opacity: 1;
}
.stats-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}
.stats-box:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}
.stats-icon {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: #fff;
}
.stats-number {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1;
}
.stats-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gallery-slider .owl-nav button,
.gallery-slider .owl-dot.active {
  background: var(--thm-primary) !important;
  background-color: var(--thm-primary) !important;
  color: #fff !important;
  box-shadow: 0 5px 20px rgba(45, 205, 124, 0.3) !important;
  border: none !important;
}

.gallery-slider .owl-nav button:hover,
.gallery-slider .owl-dot.active:hover {
  background: var(--thm-black) !important;
  background-color: var(--thm-black) !important;
  color: #fff !important;
}

.gallery-slider .owl-dot {
  background: #cbd5e1 !important;
  border: none !important;
  transition: all 0.3s;
}

/* Remove any linear-gradient background from nav/dots */
.gallery-slider .owl-nav button,
.gallery-slider .owl-dot.active {
  background-image: none !important;
}

/* Ensure nav arrows are visible */
.gallery-slider .owl-nav button i {
  color: #fff !important;
}

/* Pastikan tombol Galeri Foto tidak pakai gradasi ungu */
.gallery-section .btn-primary {
  background: var(--thm-primary) !important;
  background-color: var(--thm-primary) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
}

.gallery-section .btn-primary:hover,
.gallery-section .btn-primary:focus {
  background: var(--thm-black) !important;
  background-color: var(--thm-black) !important;
  color: #fff !important;
}

/* Stats Counter Section */
.stats-section {
  background: var(--thm-primary);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  opacity: 1;
}

.stats-box {
  <link rel="stylesheet" href="<?= base_url('frontend/towngov/css/home-custom.css') ?>" />margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pengumuman-card-title a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.3s ease;
}

.pengumuman-card-title a:hover {
  color: var(--thm-primary);
}

.pengumuman-card-excerpt {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.pengumuman-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}

.pengumuman-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.pengumuman-date i {
  color: #667eea;
}

.pengumuman-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--thm-primary);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pengumuman-link:hover {
  color: #003b49;
  gap: 10px;
}

/* Link Terkait Modern */
.link-terkait-section {
  padding: 80px 0;
  background: #f8f9fa;
  position: relative;
  overflow: hidden;
}

.link-terkait-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-radius: 50%;
  z-index: 0;
}

.link-terkait-section::after {
  content: '';
  position: absolute;
  bottom: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-radius: 50%;
  z-index: 0;
}

.link-terkait-section .container {
  position: relative;
  z-index: 1;
}

.link-terkait-header {
  text-align: center;
  margin-bottom: 50px;
}

.link-terkait-header h2 {
  font-size: 36px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.link-terkait-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--thm-primary);
  border-radius: 2px;
}

.link-terkait-header p {
  color: #64748b;
  font-size: 16px;
  margin-top: 20px;
}

.link-card {
  background: #fff;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.4s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(45, 205, 124, 0.15);
}

.link-logo {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  padding: 15px;
  border-radius: 15px;
  background: rgba(45, 205, 124, 0.05);
  transition: all 0.3s ease;
}

.link-card:hover .link-logo {
  background: rgba(45, 205, 124, 0.1);
  transform: scale(1.05);
}

.link-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.link-card:hover .link-logo img {
  filter: grayscale(0%);
}

.link-name {
  font-size: 14px;
  color: #64748b;
  margin-top: 10px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 991px) {
  .stats-section {
    padding: 50px 0;
  }

  .stats-number {
    font-size: 36px;
  }

  .pengumuman-section,
  .link-terkait-section {
    padding: 60px 0;
  }

  .link-terkait-header h2 {
    font-size: 32px;
  }
}

@media (max-width: 767px) {
  .stats-box {
    margin-bottom: 20px;
  }

  .pengumuman-card {
    margin-bottom: 20px;
  }

  .link-card {
    margin-bottom: 20px;
  }
}

/* Video Home Section */
.video-home-section {
  padding: 80px 0;
  background: #fff;
}

.video-player-wrapper {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
}

.video-player {
  position: relative;
  padding-top: 56.25%;
  /* 16:9 ratio */
  background: #000;
}

.video-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-info {
  padding-left: 40px;
}

.video-info h3 {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  line-height: 1.3;
}

.video-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
}

.meta-item i {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: #667eea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.video-description {
  font-size: 16px;
  color: #64748b;
  line-height: 1.8;
  margin-bottom: 30px;
}

@media (max-width: 991px) {
  .video-info {
    padding-left: 0;
    margin-top: 30px;
  }

  .video-info h3 {
    font-size: 26px;
  }
}

/* Gallery Modal */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  padding: 20px;
  overflow-y: auto;
}

.gallery-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-content {
  position: relative;
  max-width: 1200px;
  width: 100%;
  animation: zoomIn 0.3s ease;
}

.gallery-modal-image-wrapper {
  position: relative;
  background: #000;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-modal-image-wrapper img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  margin-left: auto;
  margin-right: auto;
}

.gallery-modal-close {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10000;
}

.gallery-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.gallery-modal-info {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 20px 30px;
  border-radius: 15px;
  margin-top: 20px;
}

.gallery-modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.gallery-modal-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  cursor: pointer;
  height: 350px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
}

.gallery-slider-wrapper {
  position: relative;
  padding: 0 50px;
}

.gallery-slider .owl-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  left: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.gallery-slider .owl-nav button {
  width: 50px;
  height: 50px;
  background: var(--thm-primary) !important;
  color: #fff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(45, 205, 124, 0.3);
  pointer-events: all;
  border: none !important;
  background-image: none !important;
}

.gallery-slider .owl-nav button:hover {
  background: var(--thm-black) !important;
  color: #fff !important;
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(30, 41, 59, 0.25);
}

.gallery-slider .owl-nav button.owl-prev {
  margin-left: -50px;
}

.gallery-slider .owl-nav button.owl-next {
  margin-right: -50px;
}

.gallery-slider .owl-dots {
  text-align: center;
  margin-top: 30px;
}

.gallery-slider .owl-dot {
  width: 12px;
  height: 12px;
  background: #cbd5e1;
  border-radius: 50%;
  margin: 0 5px;
  display: inline-block;
  transition: all 0.3s ease;
}

.gallery-slider .owl-dot.active {
  width: 30px;
  border-radius: 6px;
  background: var(--thm-primary) !important;
  background-image: none !important;
}

.gallery-slider .item {
  padding: 0 10px;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.25);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover img {
  transform: scale(1.1);
}

.gallery-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(102, 126, 234, 0.8) 100%);
  display: flex;
  align-items: flex-end;
  padding: 25px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

.gallery-overlay-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-card-overlay h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  padding-right: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-zoom-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.gallery-card:hover .gallery-zoom-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

@media (max-width: 767px) {
  .gallery-card {
    height: 250px;
    margin-bottom: 20px;
  }

  .gallery-slider-wrapper {
    padding: 0 20px;
  }

  .gallery-slider .owl-nav button.owl-prev {
    margin-left: -20px;
  }

  .gallery-slider .owl-nav button.owl-next {
    margin-right: -20px;
  }

  .gallery-modal-content {
    padding: 0 10px;
  }

  .gallery-modal-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .gallery-modal-info {
    padding: 15px 20px;
  }

  .gallery-modal-title {
    font-size: 18px;
    margin-bottom: 8px;
  }
}

/* Event Detail Modal */
.event-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 20px;
  overflow-y: auto;
}

.event-modal-content {
  background: #fff;
  max-width: 600px;
  margin: 50px auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-modal-header {
  padding: 30px;
  background: linear-gradient(135deg, var(--clr-main) 0%, var(--clr-main) 100%);
  color: #fff;
}

.event-modal-close {
  float: right;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.event-modal-close:hover {
  opacity: 1;
}

.event-modal-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  padding-right: 40px;
}

.event-modal-body {
  padding: 30px;
}

.event-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.event-detail-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.event-detail-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(var(--clr-main-rgb), 0.1) 0%, rgba(var(--clr-main-rgb), 0.1) 100%);
  color: var(--clr-main);
  border-radius: 12px;
  font-size: 18px;
  flex-shrink: 0;
}

.event-detail-content {
  flex: 1;
}

.event-detail-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.event-detail-value {
  font-size: 16px;
  color: #1e293b;
  font-weight: 600;
}

@media (max-width: 767px) {
  .event-modal-content {
    margin: 20px auto;
  }

  .event-modal-header,
  .event-modal-body {
    padding: 20px;
  }

  .event-modal-title {
    font-size: 20px;
  }
}
