/* Infrastructure Showcase Styles */
.infrastructure-showcase {
  background-color: var(--bg-color);
  position: relative;
}

.section-title {
  color: var(--font-color);
  font-weight: 600;
  position: relative;
  margin-bottom: 3rem;
}

.section-title:after {
  content: '';
  display: block;
  width: 70px;
  height: 3px;
  background: var(--primary-color, #ff6e65);
  margin: 15px auto 0;
}

.infrastructure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 250px;
  grid-gap: 20px;
}

.infra-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.infra-item.large {
  grid-column: span 2;
}

.infra-content {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.infra-image {
  height: 100%;
  overflow: hidden;
}

.infra-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.infra-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-image: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 20px;
  transform: translateY(70%);
  transition: transform 0.3s ease;
}

.infra-overlay h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
}

.infra-overlay p {
  margin: 10px 0;
  font-size: 0.9rem;
  opacity: 0;
  color: white;
  transition: opacity 0.3s ease;
}

.infra-view-more {
  display: inline-block;
  padding: 5px 15px;
  background-color: var(--primary-color, #ff6e65);
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.infra-view-more:hover {
  background-color: var(--secondary-color, #ff8a82);
  color: white;
  text-decoration: none;
}

/* Hover Effects for Desktop */
@media (hover: hover) {
  .infra-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
  }

  .infra-item:hover .infra-image img {
    transform: scale(1.1);
  }

  .infra-item:hover .infra-overlay {
    transform: translateY(0);
  }

  .infra-item:hover .infra-overlay p,
  .infra-item:hover .infra-view-more {
    opacity: 1;
  }
}

/* Touch Device Specific Styles */
.infra-item.active .infra-overlay {
  transform: translateY(0);
}

.infra-item.active .infra-overlay p,
.infra-item.active .infra-view-more {
  opacity: 1;
}

/* Modal Styles */
.modal-content {
  border-radius: 15px;
  overflow: hidden;
}

.modal-header {
  background-color: var(--primary-color, #ff6e65);
  color: white;
  border-bottom: none;
}

.modal-body {
  padding: 25px;
  position: relative;
}

.modal-footer {
  border-top: none;
}

/* Image Gallery Styles */
.modal-gallery {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.modal-gallery-container {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.modal-gallery-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.modal-gallery-container img.active {
  opacity: 1;
  z-index: 1;
}

.modal-gallery-indicators {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.gallery-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.gallery-indicator.active {
  background-color: var(--primary-color, #ff6e65);
}

/* Navigation Arrows */
.modal-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 15px;
}

.modal-nav button {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.modal-nav button:hover {
  background-color: rgba(0,0,0,0.7);
}

.infraModalClose {
    background-color: black;
    color: white;
    border: none;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    outline: none;
}

@media (max-width: 1200px) {
  .infraModalClose {
    font-size: calc(1.275rem + 0.3vw);
  }
}

.infraModalClose:hover {
  color: red;
  text-decoration: none;
  text-decoration: none;
}

/* Touch Swiping styles */
.swipe-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .infra-item.large {
    grid-column: span 1;
  }
}

@media (max-width: 767px) {
  .infrastructure-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 220px;
  }
  
  .infra-overlay {
    transform: translateY(60%);
  }
  
  .modal-body .row {
    flex-direction: column;
  }
  
  .modal-body .col-md-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }
  
  .modal-gallery-container {
    height: 200px;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .infrastructure-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-gallery-container {
    height: 180px;
  }
}