/*--------------------------------------------------------------
Before After Section Enhancements
----------------------------------------------------------------*/

/* Main Section Styling */
.cs_before_after_section {
  padding-top: 80px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.cs_before_after_section:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23e9ecef" opacity="0.3"/><circle cx="75" cy="75" r="1" fill="%23e9ecef" opacity="0.3"/><circle cx="50" cy="10" r="0.5" fill="%23e9ecef" opacity="0.2"/><circle cx="10" cy="60" r="0.5" fill="%23e9ecef" opacity="0.2"/><circle cx="90" cy="40" r="0.5" fill="%23e9ecef" opacity="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
  opacity: 0.1;
  z-index: 1;
}

.cs_before_after_section .container {
  position: relative;
  z-index: 2;
}

/* Section Heading Enhancements */
.cs_before_after_section .cs_section_heading {
  margin-bottom: 60px;
}

.cs_before_after_section .cs_section_text {
  max-width: 600px;
  margin: 20px auto 0;
  line-height: 1.6;
}

/* Before After Wrapper */
.cs_before_after_wrapper {
  margin-bottom: 60px;
}

/* Enhanced Grouped Before After Layout */
.cs_before_after_group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 8px;
}

.cs_before_after_pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.cs_before_after_pair:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.1);
}

.cs_before_image,
.cs_after_image {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.cs_before_image img,
.cs_after_image img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.cs_before_image:hover img,
.cs_after_image:hover img {
  transform: scale(1.02);
}

/* Enhanced Labels */
.cs_before_label,
.cs_after_label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Info Section */
.cs_before_after_info {
  margin-top: 40px;
}

.cs_before_after_info .cs_info_text {
  line-height: 1.7;
  margin-bottom: 30px;
  color: var(--heading-color, #333);
}

.cs_before_after_info .cs_btn_wrap {
  margin-top: 20px;
}

.cs_before_after_info .cs_btn {
  padding: 15px 35px;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.cs_before_after_info .cs_btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1199px) {
  .cs_before_after_section {
    padding: 80px 0;
  }
  
  .cs_before_after.cs_style_1 {
    min-height: 500px;
  }
  
  .cs_before_after.cs_style_1 .cs_before_after_inner {
    min-height: 500px;
  }
}

@media (max-width: 991px) {
  .cs_before_after_section {
    padding: 60px 0;
  }
  
  .cs_before_after.cs_style_1 {
    min-height: 400px;
  }
  
  .cs_before_after.cs_style_1 .cs_before_after_inner {
    min-height: 400px;
  }
  
  .cs_before_after.cs_style_1 .cs_before_badge,
  .cs_before_after.cs_style_1 .cs_after_badge {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .cs_before_after.cs_style_1 .cs_before_badge {
    top: 20px;
    left: 20px;
  }
  
  .cs_before_after.cs_style_1 .cs_after_badge {
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 767px) {
  .cs_before_after_section {
    padding: 40px 0;
  }
  
  .cs_before_after.cs_style_1 {
    min-height: 300px;
    border-radius: 15px;
  }
  
  .cs_before_after.cs_style_1 .cs_before_after_inner {
    min-height: 300px;
  }
  
  .cs_before_after.cs_style_1 .cs_single_slide {
    border-radius: 15px;
  }
  
  .cs_before_after.cs_style_1 .cs_single_slide.cs_before {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  
  .cs_before_after.cs_style_1 .cs_single_slide.cs_after {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  
  .cs_before_after.cs_style_1 .cs_handle_before_after span {
    height: 50px;
    width: 50px;
  }
  
  .cs_before_after.cs_style_1 .cs_handle_before_after span i {
    font-size: 12px;
  }
}

/* Animation Enhancements */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cs_before_after_wrapper {
  animation: slideInUp 0.8s ease-out;
}

/* Hover Effects */
.cs_before_after.cs_style_1:hover {
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

/* Loading State */
.cs_before_after.cs_style_1.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}





.cs_tool_btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--heading-color, #333);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cs_tool_btn:hover {
  background: var(--accent-color, #007bff);
  color: #fff;
  transform: scale(1.1);
}

.cs_tool_btn.active {
  background: var(--accent-color, #007bff);
  color: #fff;
}

/* Image Info */
.cs_image_info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 20px;
  z-index: 10;
}

.cs_info_item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cs_info_label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-color, #007bff);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs_info_value {
  font-size: 11px;
  color: var(--heading-color, #333);
  margin-top: 2px;
}

/* Fullscreen Modal */
.cs_fullscreen_modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cs_fullscreen_modal.active {
  display: flex;
}

.cs_modal_content {
  background: #fff;
  border-radius: 15px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cs_modal_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.cs_modal_title {
  font-size: 18px;
  font-weight: 600;
  color: var(--heading-color, #333);
  margin: 0;
}

.cs_modal_close {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #f5f5f5;
  color: var(--heading-color, #333);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.cs_modal_close:hover {
  background: var(--accent-color, #007bff);
  color: #fff;
}

.cs_modal_body {
  display: flex;
  height: 400px;
}

.cs_modal_before,
.cs_modal_after {
  flex: 1;
  position: relative;
  overflow: hidden;
}

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

.cs_modal_label {
  position: absolute;
  bottom: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
  .cs_before_after_group {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
  }
  
  .cs_before_after_pair {
    gap: 10px;
    padding: 14px;
  }
  
  .cs_before_image img,
  .cs_after_image img {
    height: 240px;
  }
}

@media (max-width: 991px) {
  .cs_before_after_group {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    padding: 18px;
  }
  
  .cs_before_after_pair {
    gap: 8px;
    padding: 12px;
  }
  
  .cs_before_image img,
  .cs_after_image img {
    height: 220px;
  }
  
  .cs_before_label,
  .cs_after_label {
    bottom: 10px;
    padding: 6px 12px;
    font-size: 10px;
  }
}

@media (max-width: 767px) {
  .cs_before_after_group {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .cs_before_after_pair {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px;
  }
  
  .cs_before_image img,
  .cs_after_image img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .cs_before_after_group {
    padding: 12px;
  }
  
  .cs_before_after_pair {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }
  
  .cs_before_image img,
  .cs_after_image img {
    height: 220px;
  }
}

/* Grouped Animation */
.cs_before_after_group {
  animation: fadeInUp 0.8s ease;
}

.cs_before_after_pair {
  animation: fadeInUp 0.8s ease;
  animation-fill-mode: both;
}

.cs_before_after_pair:nth-child(1) { animation-delay: 0.1s; }
.cs_before_after_pair:nth-child(2) { animation-delay: 0.2s; }
.cs_before_after_pair:nth-child(3) { animation-delay: 0.3s; }
.cs_before_after_pair:nth-child(4) { animation-delay: 0.4s; }
.cs_before_after_pair:nth-child(5) { animation-delay: 0.5s; }
.cs_before_after_pair:nth-child(6) { animation-delay: 0.6s; }
.cs_before_after_pair:nth-child(7) { animation-delay: 0.7s; }
.cs_before_after_pair:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
