/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 80px);
  padding-top: clamp(100px, 15vw, 140px);
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
  padding-bottom: 2rem;
}

.page-content {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.page-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: #1e3a2e;
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.page-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #2d5a42;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Gallery Tabs */
.gallery-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  gap: 1rem;
  flex-wrap: wrap;
}

.gallery-tab {
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 4vw, 2rem);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  white-space: nowrap;
  font-size: clamp(0.9rem, 2vw, 1rem);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
  opacity: 0.7;
}

.gallery-tab.active,
.gallery-tab:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.5);
  background: linear-gradient(45deg, #229954, #27ae60);
}

.gallery-tab:focus {
  outline: 2px solid #27ae60;
  outline-offset: 2px;
}

/* Gallery Content */
.gallery-content {
  margin-top: 2rem;
}

.gallery-section {
  display: none;
}

.gallery-section.active {
  display: block;
}

/* Images Grid */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: 2rem;
}

/* Image Cards */
.image-card {
  background: rgba(248, 249, 250, 0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 4px solid #27ae60;
  backdrop-filter: blur(5px);
}

.image-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(39, 174, 96, 0.25);
  background: rgba(255, 255, 255, 0.98);
}

#commercial-section .image-card {
  border-left: 4px solid #3498db;
}

#commercial-section .image-card:hover {
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.25);
}

/* Image Placeholders */
.image-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: white;
  overflow: hidden;
  position: relative;
}

#commercial-section .image-placeholder {
  background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
}

.image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 0;
  opacity: 1;
}

.image-card:hover .image-placeholder img {
  transform: scale(1.05);
}

/* Image Info Section */
.image-info {
  padding: clamp(1rem, 4vw, 1.5rem);
}

.image-title {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  color: #1e3a2e;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.image-description {
  color: #444;
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.image-specs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(39, 174, 96, 0.2);
}

.spec-label {
  font-weight: 500;
  color: #1e3a2e;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
}

.spec-value {
  color: #2d5a42;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
}

/* MODAL AND CAROUSEL STYLES */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 10px;
  box-sizing: border-box;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  width: 100%;
  max-width: min(800px, 95vw);
  max-height: min(90vh, 700px);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.25rem) clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid rgba(39, 174, 96, 0.2);
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.05), rgba(46, 204, 113, 0.05));
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: #1e3a2e;
  font-weight: 600;
  flex: 1;
  margin-right: 1rem;
  word-break: break-word;
}

.close-btn {
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  border: none;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  cursor: pointer;
  color: white;
  padding: 0.5rem;
  width: clamp(35px, 8vw, 40px);
  height: clamp(35px, 8vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.close-btn:hover {
  background: linear-gradient(45deg, #229954, #27ae60);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.5);
}

.modal-body {
  padding: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* CAROUSEL */
.carousel-container {
  position: relative;
  width: 100%;
  height: clamp(250px, 40vh, 400px);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.05), rgba(46, 204, 113, 0.05));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px); /* Safari support */
  flex-shrink: 0;
  touch-action: pan-y pinch-zoom;
}

.carousel-track {
  display: flex;
  height: 100%;
  width: 500%;
  transition: transform 0.4s ease-in-out;
}

.carousel-slide {
  width: 20%;
  height: 100%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 20px;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-slide img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  width: clamp(35px, 8vw, 45px);
  height: clamp(35px, 8vw, 45px);
  font-size: clamp(16px, 4vw, 20px);
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.carousel-nav:hover {
  background: linear-gradient(45deg, #229954, #27ae60);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.6);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-indicator {
  width: clamp(10px, 2.5vw, 12px);
  height: clamp(10px, 2.5vw, 12px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(39, 174, 96, 0.5);
}

.carousel-indicator.active {
  background: #27ae60;
  transform: scale(1.2);
  border-color: #27ae60;
}

/* Enlarge Hint - Default desktop styles */
.enlarge-hint {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  z-index: 12;
  opacity: 1;
  pointer-events: none;
  display: block;
}

/* Modal Info Section */
.modal-info {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: rgba(248, 249, 250, 0.8);
  flex-shrink: 0;
  position: relative;
}

.modal-description {
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.7;
  color: #444;
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(0.75rem, 2vw, 1rem);
}

.modal-spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(0.75rem, 2vw, 1rem);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border-left: 3px solid #27ae60;
  min-height: 1.5rem;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.modal-spec-item:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.modal-spec-item .spec-label {
  font-weight: 600;
  color: #1e3a2e;
  white-space: nowrap;
  margin-right: 1rem;
  flex-shrink: 0;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
}

.modal-spec-item .spec-value {
  color: #2d5a42;
  white-space: nowrap;
  text-align: right;
  flex-shrink: 0;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
}

/* Fullscreen Modal Styles */
.fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.fullscreen-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.fullscreen-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fullscreen-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.fullscreen-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.fullscreen-nav:hover {
  background: linear-gradient(45deg, #229954, #27ae60);
  scale: 1.1;
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.6);
}

.fullscreen-prev {
  left: 20px;
}

.fullscreen-next {
  right: 20px;
}

.fullscreen-text {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1rem;
  opacity: 0.8;
  pointer-events: none;
}

/* Footer */
.footer {
  background: #1e3a2e;
  color: white;
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem) 1rem;
  margin-top: clamp(2rem, 6vw, 4rem);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  margin-bottom: 2rem;
  color: #2ecc71;
  font-weight: 700;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  margin-bottom: 2rem;
  text-align: center;
}

.footer-section h4 {
  color: #2ecc71;
  margin-bottom: 1rem;
  font-size: clamp(1.1rem, 2.5vw, 1.2rem);
  font-weight: 600;
}

.footer-section p {
  margin-bottom: 0.5rem;
  opacity: 0.9;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #2d5a42;
  opacity: 0.8;
  font-size: clamp(0.85rem, 2vw, 1rem);
}

/* Mobile Specific Responsive Adjustments */

@media (max-width: 768px) {
  .main-content {
    padding-top: 90px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .images-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-tabs {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  
  .gallery-tab {
    width: 200px;
    text-align: center;
  }
  
  .modal {
    padding: 5px;
  }
  
  .modal-content {
    max-height: 95vh;
  }
  
  .carousel-container {
    height: clamp(200px, 35vh, 300px);
  }
  
  .carousel-nav {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .carousel-prev {
    left: 5px;
  }
  
  .carousel-next {
    right: 5px;
  }
  
  .modal-specs {
    grid-template-columns: 1fr;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-info {
    padding: 1rem;
  }
  
  .carousel-slide {
    padding: 10px;
  }

  .fullscreen-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .fullscreen-prev {
    left: 10px;
  }

  .fullscreen-next {
    right: 10px;
  }

  .fullscreen-text {
    font-size: 0.9rem;
    bottom: 80px;
  }

  /* Mobile-specific positioning for enlarge hint */
  .enlarge-hint {
    position: absolute !important;
    top: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: auto !important;
    right: auto !important;
    background: rgba(39, 174, 96, 0.9) !important;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: center;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    pointer-events: none;
    z-index: 15;
    white-space: nowrap;
    display: block !important;
  }
}

@media (max-width: 360px) {
  .main-content {
    padding-top: 75px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .modal {
    padding: 2px;
  }
  
  .carousel-container {
    height: 180px;
  }
  
  .modal-header {
    padding: 0.5rem;
  }
  
  .modal-info {
    padding: 0.75rem;
  }

  .fullscreen-nav {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .fullscreen-text {
    font-size: 0.8rem;
  }

  .enlarge-hint {
    font-size: 0.7rem;
    padding: 6px 10px;
    top: 5px;
  }
}

/* Large screen optimizations */
@media (min-width: 1400px) {
  .page-content,
  .footer-content {
    max-width: 1400px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
.nav-link:focus,
.gallery-tab:focus,
.image-card:focus,
.close-btn:focus,
.carousel-nav:focus,
.carousel-indicator:focus,
.fullscreen-nav:focus {
  outline: 2px solid #27ae60;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .image-card,
  .modal-content {
    border: 2px solid #27ae60;
  }
  
  .gallery-tab {
    border: 2px solid #27ae60;
  }
}