/* Facilities Page Specific Styles */

/* Active navigation state */
.nav-items a.active {
  color: var(--green);
}

.nav-items a.active::after {
  width: 100%;
  background-color: var(--green);
}

/* Hero section */
.facilities-hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  color: var(--light-grey);
  background-color: var(--dark-grey);
}

.facilities-hero .hero-image-wrap {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background-color: var(--dark-grey);
}

.facilities-hero .hero-image-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.facilities-hero #hero-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.9;
}

.facilities-hero .content {
  position: relative;
  z-index: 2;
}

.facilities-hero .scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  animation: float 2s ease-in-out infinite;
}

/* Facilities intro section */
.facilities-intro {
  padding: 100px 0;
  background-color: white;
  color: var(--dark-grey);
}

/* Partnership Locations Section */
.partnership-locations {
  padding: 100px 0;
  background: var(--light-grey);
}

.location-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.location-card {
  background: #f8f9fa;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.location-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.location-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.location-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.location-card:hover .location-image img {
  /* transform: scale(1.05); */
}

.location-content {
  padding: 30px;
}

.location-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.location-content p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

.location-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-tag {
  background: #4CAF50;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Business Operations Map Section */
.business-operations-map {
  padding: 100px 0;
  background: #f8f9fa;
}

/* Facility Locations Section */
.facility-locations {
  padding: 100px 0;
  background-color: white;
  color: var(--dark-grey);
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 60px;
  margin-top: 60px;
}

.location-item {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.location-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.location-item .location-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.location-item .location-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.location-item:hover .location-image img {
  transform: scale(1.05);
}

.location-item .location-description {
  padding: 30px;
}

.location-item .location-title {
  margin: 0 0 20px 0;
  padding: 30px 30px 0 30px;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--dark-grey);
  text-align: left;
}

.location-item .location-description p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--dark-grey);
}

.map-container {
  margin-top: 60px;
}

.interactive-map {
  position: relative;
  width: 100%;
  height: 600px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

/* Leaflet map container */
#north-america-map {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  overflow: hidden;
  min-height: 600px;
  background: #f0f0f0;
  position: relative;
}

/* Map loading indicator */
.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.map-loading p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

/* Custom Leaflet styles */
.leaflet-container {
  background: #f8f9fa;
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  font-family: 'Clash Grotesk', sans-serif;
  width: 450px !important;
  height: 380px !important;
}

.leaflet-popup-tip {
  background: white;
}

/* Map styling to match reference photo */
.leaflet-tile-pane {
  filter: grayscale(0.3) contrast(1.2);
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.8) !important;
  color: #333 !important;
  font-size: 11px !important;
}

/* Hide zoom controls */
.leaflet-control-zoom {
  display: none !important;
}

/* Hide bottom right controls */
.leaflet-bottom.leaflet-right {
  display: none !important;
}

/* Custom marker styles - Medium green gradient circles (approximately 50% of original size) */
.custom-marker {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  text-align: center;
  line-height: 1;
  position: relative;
}

/* Center the SVG icon within the marker */
.custom-marker svg {
  display: block;
  margin: auto;
  width: 16px;
  height: 16px;
  transform: translateY(18px);
}

.custom-marker:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.custom-marker.hover {
  transform: scale(1.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.custom-marker.storage-facility {
  background: radial-gradient(circle, rgba(59, 118, 96, 0.9) 0%, rgba(59, 118, 96, 0.8) 30%, rgba(59, 118, 96, 0.6) 60%, rgba(59, 118, 96, 0.4) 100%);
}

.custom-marker.processing-plant {
  background: radial-gradient(circle, rgba(59, 118, 96, 0.9) 0%, rgba(59, 118, 96, 0.8) 30%, rgba(59, 118, 96, 0.6) 60%, rgba(59, 118, 96, 0.4) 100%);
}

.custom-marker.existing-customer {
  background: radial-gradient(circle, rgba(59, 118, 96, 0.9) 0%, rgba(59, 118, 96, 0.8) 30%, rgba(59, 118, 96, 0.6) 60%, rgba(59, 118, 96, 0.4) 100%);
}

.custom-marker.target-customer {
  background: radial-gradient(circle, rgba(59, 118, 96, 0.9) 0%, rgba(59, 118, 96, 0.8) 30%, rgba(59, 118, 96, 0.6) 60%, rgba(59, 118, 96, 0.4) 100%);
}

/* Hover tooltip for markers */
.custom-marker::after {
  content: attr(data-hover-text);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.custom-marker:hover::after {
  opacity: 1;
  visibility: visible;
}



/* Map marker styles for Leaflet */
.map-marker-popup {
  font-family: 'Clash Grotesk', sans-serif;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  width: 450px;
  height: 380px;
}

.popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.8) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  z-index: 2;
}

.popup-description {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
  line-height: 1.3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  max-width: 100%;
  word-wrap: break-word;
}

.map-marker-popup .features {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.95);
  z-index: 3;
}

.map-marker-popup .feature-tag {
  background: #4CAF50;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 40px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

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

.close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.close:hover {
  color: #333;
}

#modal-content {
  margin-top: 20px;
}

.modal-location-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
}

.modal-location-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.modal-location-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-location-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Sustainability section */
.sustainability {
  padding: 100px 0;
  background-color: var(--dark-grey);
  color: var(--light-grey);
}

/* Page transition animation */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--green);
  z-index: 9998;
  transform: translateY(100%);
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

.page-transition.active {
  transform: translateY(0);
}

.page-transition.fade-out {
  transform: translateY(-100%);
}

/* Media Queries */
@media screen and (max-width: 992px) {
  .location-cards {
    grid-template-columns: 1fr;
  }
  
  .location-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .interactive-map {
    height: 400px;
  }
  
  #north-america-map {
    height: 400px;
  }
  
  .map-marker-popup {
    width: 400px;
    height: 320px;
  }
}

@media screen and (max-width: 576px) {
  .facilities-hero {
    height: 70vh;
  }
  
  .location-content {
    padding: 20px;
  }
  
  .location-content h3 {
    font-size: 1.3rem;
  }
  
  .location-grid {
    gap: 30px;
  }
  
  .location-item .location-image {
    height: 200px;
  }
  
  .location-item .location-description {
    padding: 20px;
  }
  
  .location-item .location-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding: 20px 20px 0 20px;
  }
  
  .location-item .location-description p {
    font-size: 1rem;
  }
  
  .interactive-map {
    height: 300px;
  }
  
  #north-america-map {
    height: 300px;
  }
  
  .custom-marker {
    width: 30px;
    height: 30px;
    font-size: 8px;
  }
  
  .map-marker-popup {
    width: 320px;
    height: 270px;
  }
  
  .modal-content {
    margin: 15% auto;
    padding: 20px 15px;
  }
} 