/* Services Gallery */
.services-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}
.service-gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  height: 300px;
}
.service-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}
.service-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.service-gallery-item:hover .service-gallery-img {
  transform: scale(1.1);
}
.service-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(30, 58, 138, 0.9) 0%, rgba(30, 58, 138, 0.3) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}
.service-gallery-item:hover .service-gallery-overlay {
  opacity: 1;
}
.service-gallery-content {
  color: white;
  text-align: left;
}
.service-gallery-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: white;
}
.service-gallery-summary {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.9;
  color: white;
  margin-bottom: 1rem;
}
.service-gallery-click {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
/* Service Modal */
.service-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}
.service-modal-content {
  position: relative;
  background-color: white;
  margin: 2% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}
.service-modal-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #aaa;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.9);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.service-modal-close:hover,
.service-modal-close:focus {
  color: #000;
  background: white;
}
.service-modal-header {
  padding: 2rem 2rem 1rem 2rem;
  border-bottom: 1px solid #eee;
}
.service-modal-title {
  font-size: 2rem;
  color: #1e3a8a;
  margin: 0;
}
.service-modal-body {
  padding: 2rem;
}
/* Service Slideshow */
.service-slideshow-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto 2rem auto;
  border-radius: 10px;
  overflow: hidden;
}
.service-slides-wrapper {
  position: relative;
  height: 400px;
  overflow: hidden;
}
.service-slides {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}
.service-slide {
  min-width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
}
.service-prev, .service-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -50px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  user-select: none;
  transition: background 0.3s ease;
}
.service-next {
  right: 0;
}
.service-prev:hover, .service-next:hover {
  background: rgba(0, 0, 0, 0.8);
}
.service-dots-container {
  text-align: center;
  padding: 1rem 0;
}
.service-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.service-dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}
.service-dot.active, .service-dot:hover {
  background-color: #1e3a8a;
}
.service-description-content {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 10px;
  line-height: 1.8;
  font-size: 1.1rem;
}
.service-description-content h4 {
  color: #1e3a8a;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
.service-description-content ul {
  list-style: none;
  padding-left: 0;
}
.service-description-content li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}
.service-description-content li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Main service section layout & controls */
.service-container {
  max-width: 1200px;
  width: 100%;
}
.service-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}
.service-menu {
  color: #FFF;
  padding: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 120px;
}
.service-menu h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent-cyan);
  text-align: center;
  border-bottom: 2px solid var(--accent-cyan);
  padding-bottom: 0.5rem;
}
.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.service-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
}
.service-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(5px);
}
.service-item.active {
  border-color: rgba(255, 255, 255, 0.5);
}
.service-icon {
  font-size: 1.5rem;
  min-width: 2rem;
  text-align: center;
  display: inline-block;
}
.service-text {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}
.service-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.service-gallery-container {
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.service-gallery-container.is-changing {
  opacity: 0;
  transform: translateY(10px);
}
/* This container now holds the Facebook-style gallery */
.service-main-image {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  /* The border is removed from here to avoid double borders with the gallery */
}
.service-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  padding: 2rem;
  color: white;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  /* pointer-events are auto by default, allowing text selection when visible */
}
.service-gallery-container:hover .service-overlay {
  opacity: 1;
  transform: translateY(0);
}
.service-overlay h3 {
  /* Changed from h4 to h3 to match JS */
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-cyan);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.service-overlay p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}
/* Thumbnails */
.service-thumbnails {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.service-thumb-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
}
.service-thumb {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  opacity: 0.6;
}
.service-thumb:hover {
  opacity: 0.9;
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
}
.service-thumb.active {
  opacity: 1;
  border-color: var(--accent-cyan);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
}
/* Background layers for service main image (used by services.js) */
.service-main-bg {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}
.service-bg-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 300ms ease;
}
.service-bg-layer:first-child {
  opacity: 1;
}
/* Responsive Design for Service Section */
@media (max-width: 968px) {
  .service-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .service-menu {
    position: static;
    order: 2;
  }
  .service-gallery {
    order: 1;
  }
  .service-main-bg {
    height: 350px;
  }
  .service-thumb-track {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }
}
@media (max-width: 768px) {
  .service-section {
    padding: 80px 3% 60px;
  }
  .service-section h2 {
    font-size: 2rem;
  }
  .service-menu {
    padding: 1.5rem;
  }
  .service-text {
    font-size: 0.8rem;
  }
  .service-main-bg {
    height: 300px;
  }
  .service-overlay {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
  }
  .service-overlay h4 {
    font-size: 1.2rem;
  }
  .service-thumb {
    height: 50px;
  }
}
@media (max-width: 480px) {
  .service-section h2 {
    font-size: 1.8rem;
  }
  .service-menu h3 {
    font-size: 1.3rem;
  }
  .service-text {
    font-size: 0.75rem;
  }
  .service-main-bg {
    height: 250px;
  }
  .service-overlay h4 {
    font-size: 1.1rem;
  }
  .service-overlay p {
    font-size: 0.8rem;
  }
  .service-thumb-track {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.5rem;
  }
  .service-thumb {
    height: 40px;
  }
  .service-slides-wrapper {
    height: 250px;
  }
}
/* === Facebook-style Gallery & Modal Styles === */
.service-image-gallery {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 12;
}
.gallery-item {
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  transition: filter 0.2s ease-in-out;
}
.gallery-item:hover {
  filter: brightness(0.9);
}
/* Layout for 1 image */
.gallery-count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
/* Layout for 2 images */
.gallery-count-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
/* Layout for 3 images */
.gallery-count-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.gallery-count-3 .item-1 {
  grid-row: 1 / 3;
  grid-column: 1 / 2;
}
.gallery-count-3 .item-2 {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
}
.gallery-count-3 .item-3 {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
}
/* Layout for 4+ images */
.gallery-count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
}
/* --- Modal Styles --- */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 1050;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s;
}
.modal-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}
.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}
.close-modal:hover {
  color: #bbb;
}
.prev-slide, .next-slide {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -30px;
  color: white;
  font-weight: bold;
  font-size: 24px;
  transition: 0.3s ease;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 0 3px 3px 0;
}
.next-slide {
  right: 0;
  border-radius: 3px 0 0 3px;
}
.prev-slide:hover, .next-slide:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
@keyframes fadeIn {
  from {
    opacity: 0
  }
  to {
    opacity: 1
  }
}