/* Media Gallery Styles - Fully Updated */

/* Page Hero Section (existing styles are fine) */
.page-hero {
  background: linear-gradient(
      to bottom,
      rgba(0, 96, 100, 0.9) 0%,
      rgba(0, 96, 100, 0.6) 40%,
      rgba(0, 96, 100, 0.4) 70%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    url("../assets/images/homeHero.jpg");
  color: white;
  padding: 8rem 0;
  text-align: center;
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main content container */
.main-content {
  background: white;
  position: relative;
  z-index: 10;
}

/* Media Sections */
.media-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.media-section:first-of-type {
  margin-top: -150px;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
  padding-top: 6rem;
  background: #f9fafb;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Service & Media Grids */
.service-category {
  margin-bottom: 3rem;
}
.service-title {
  font-size: 2rem;
  font-weight: 600;
  color: #374151;
  text-align: left;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.service-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* NEW: Load More Button Style */
.load-more-btn {
  grid-column: 1 / -1; /* Span full width */
  justify-self: center;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background-color: #1e3a8a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  margin-top: 1rem;
}
.load-more-btn:hover {
  background-color: #1e40af;
  transform: translateY(-2px);
}

/* NEW: Universal Media Card Style */
.media-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0; /* Initially hidden for scroll animation */
  transform: translateY(20px);
  animation: fade-in 0.5s ease-out forwards;
}

.media-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.media-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.media-card-thumbnail {
  width: 100%;
  padding-top: 60%; /* Aspect ratio 5:3 */
  background-color: #e5e7eb;
  position: relative;
  background-size: cover;
  background-position: center;
}

.media-card-thumbnail .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.media-card-info {
  padding: 1rem 1.25rem;
}

.media-card-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
  color: #111827;
  font-weight: 600;
}

.media-card-description {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em; /* 0.9rem * 1.5 line-height * 2 lines */
}

/* Before & After Section */
.before-after-item {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 3rem;
}
.project-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
  text-align: center;
}
.project-main-description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2rem auto;
  color: #4b5563;
}
.comparison-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.before-after-card {
  display: flex;
  flex-direction: column;
}
.image-label {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
  text-transform: uppercase;
  text-align: center;
  align-self: center;
}
.before .image-label {
  background: #ef4444;
}
.after .image-label {
  background: #22c55e;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  grid-column: 1 / -1;
  font-style: italic;
}

/* NEW: Professional Modal Styles */
.media-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeInModal 0.3s forwards;
}

@keyframes fadeInModal {
  to {
    opacity: 1;
  }
}

.media-modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  width: 1200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  animation: zoomInModal 0.3s forwards;
}

@keyframes zoomInModal {
  to {
    transform: scale(1);
  }
}

.modal-media-area {
  position: relative;
  flex-grow: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-media-item {
  max-width: 100%;
  max-height: calc(90vh - 120px); /* Adjust for info area height */
  object-fit: contain;
}

.modal-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  z-index: 10;
  transition: background 0.2s;
}
.modal-nav-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}
.modal-nav-arrow.prev {
  left: 10px;
}
.modal-nav-arrow.next {
  right: 10px;
}

.modal-info-area {
  padding: 1.5rem 2rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  max-height: 120px;
  overflow-y: auto;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3a8a;
  margin: 0 0 0.5rem 0;
}

.modal-description {
  font-size: 1rem;
  color: #4b5563;
  line-height: 1.6;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: rotate(90deg);
}

/* Responsive Design */
@media (max-width: 768px) {
  .comparison-wrapper {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 2.5rem;
  }
  .media-section {
    padding: 3rem 1rem;
  }
  .media-section:first-of-type {
    margin-top: -100px;
  }
  .media-modal-content {
    max-width: 95vw;
    max-height: 85vh;
  }
  .modal-info-area {
    padding: 1rem;
  }
  .modal-title {
    font-size: 1.2rem;
  }
  .modal-description {
    font-size: 0.9rem;
  }
}
@keyframes fadeOutModal {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes zoomOutModal {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(0.95);
  }
}
