
.main {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 54px 20px;
  color: var(--text-2);
}

/* Hero Section */
.beforeAfterHero {
  text-align: center;
  margin-bottom: 60px;
  padding: 40px 0;
  background: linear-gradient(135deg, rgba(1, 182, 113, 0.1) 0%, rgba(255, 236, 48, 0.1) 100%);
  border-radius: 20px;
  border: 2px solid rgba(1, 182, 113, 0.2);
}

.heroTitle {
  color: var(--text);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.heroDescription {
  font-size: 18px;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-2);
}

/* Controls Section */
.beforeAfterControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.viewModeToggle {
  display: flex;
  gap: 10px;
}

.modeBtn {
  padding: 12px 24px;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modeBtn:hover,
.modeBtn.active {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(1, 182, 113, 0.3);
}

.filterControls select {
  padding: 12px 20px;
  border: 2px solid var(--primary);
  border-radius: 25px;
  background: white;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

/* Comparison View */
.comparisonView {
  display: none;
}

.comparisonView.active {
  display: block;
}

.comparisonContainer {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
}

.imageComparison {
  position: relative;
  margin-bottom: 30px;
}

.beforeAfterSlider {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.beforeAfterSlider.dragging {
  cursor: grabbing;
}

.beforeImage,
.afterImage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.afterImage {
  clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%);
}

.sliderHandle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  transform: translateX(-50%);
  z-index: 10;
  cursor: ew-resize;
  touch-action: none;
}

.sliderHandle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sliderHandle::after {
  content: '⟵ ⟶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: var(--primary);
  font-weight: bold;
  z-index: 1;
}

.sliderLine {
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
  border-radius: 2px;
}

.sliderButton {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: white;
  border: 3px solid var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.imageLabels {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
}

.beforeLabel,
.afterLabel {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
}

.afterLabel {
  background: var(--primary);
}

/* Navigation Controls */
.navigationControls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.navBtn {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navBtn:hover {
  background: var(--secondary);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.navBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.imageCounter {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding: 12px 24px;
  background: #f8f9fa;
  border-radius: 25px;
}

/* Thumbnail Gallery */
.thumbnailGallery {
  margin-top: 40px;
}

.thumbnailContainer {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 15px;
}

.thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(1, 182, 113, 0.3);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grid View */
.gridView {
  display: none;
}

.gridView.active {
  display: block;
}

.gridContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.gridItem {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gridItem:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.gridItem img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.gridItemContent {
  padding: 20px;
  text-align: center;
}

.gridItemTitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.gridItemType {
  font-size: 14px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 90%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modalContent {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.closeModal {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

.closeModal:hover {
  color: var(--secondary);
}

.modalImageContainer {
  background: white;
  border-radius: 10px;
  padding: 5px;
}

.modalImageContainer img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 5px;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(1, 182, 113, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main {
    padding: 30px 10px;
  }
  
  .beforeAfterControls {
    flex-direction: column;
    gap: 20px;
  }
  
  .viewModeToggle {
    width: 100%;
    justify-content: center;
  }
  
  .beforeAfterSlider {
    height: 300px;
  }
  
  .navigationControls {
    flex-direction: column;
    gap: 15px;
  }
  
  .thumbnailContainer {
    justify-content: center;
  }
  
  .gridContainer {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .heroTitle {
    font-size: 28px;
  }
  
  .heroDescription {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .comparisonContainer {
    padding: 15px;
  }
  
  .beforeAfterSlider {
    height: 250px;
  }
  
  .sliderHandle {
    width: 6px;
  }
  
  .sliderHandle::before {
    width: 50px;
    height: 50px;
  }
  
  .sliderHandle::after {
    font-size: 18px;
  }
  
  .modeBtn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .navBtn {
    padding: 10px 16px;
    font-size: 14px;
  }
}
