/* =========================
   PORTFOLIO MASONRY STYLES
========================= */

/* FILTRES */
.filters-section {
  padding: 40px 0 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.filters-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.filter-btn {
  background: #f7f4f1;
  border: 2px solid transparent;
  color: #3a3a3a;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background: #fff;
  border-color: #c9a24d;
  color: #c9a24d;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(201, 162, 77, 0.2);
}

.filter-btn.active {
  background: linear-gradient(135deg, #c9a24d, #b0893e);
  color: #fff;
  border-color: #c9a24d;
  box-shadow: 0 5px 20px rgba(201, 162, 77, 0.3);
}

.filter-btn i {
  font-size: 1.1rem;
}

/* STATS SECTION */
.stats-section {
  padding: 50px 0;
  background: linear-gradient(135deg, #faf8f6, #f7f4f1);
}

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #c9a24d;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-label {
  color: #6b6b6b;
  font-size: 0.95rem;
}

/* PORTFOLIO MASONRY GRID */
.portfolio-masonry-section {
  padding: 60px 0 80px;
  background: #f7f4f1;
}

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: 250px;
  gap: 20px;
  padding: 0 20px;
}

.masonry-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variantes de tailles */
.masonry-item.tall {
  grid-row: span 2;
}

.masonry-item.wide {
  grid-column: span 2;
}

/* CARTE PORTFOLIO */
.portfolio-card-masonry {
  position: relative;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.4s ease;
}

.portfolio-card-masonry:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.portfolio-card-masonry img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card-masonry:hover img {
  transform: scale(1.08);
}

/* OVERLAY */
.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85),
    rgba(0,0,0,0.4) 50%,
    rgba(0,0,0,0.1)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card-masonry:hover .masonry-overlay {
  opacity: 1;
}

.overlay-content {
  text-align: center;
  color: #fff;
}

.view-text {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.3);
}

/* INFO EN BAS */
.masonry-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.9),
    transparent
  );
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.portfolio-card-masonry:hover .masonry-info {
  transform: translateY(0);
}

.masonry-info h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.masonry-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.stat-badge.success {
  background: rgba(40, 167, 69, 0.9);
  color: #fff;
}

.stat-badge.premium {
  background: linear-gradient(135deg, #c9a24d, #b0893e);
  color: #fff;
}

/* =========================
   MODAL SLIDER AVANT/APRÈS
========================= */

.modal-slider {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-slider.active {
  display: flex;
}

.modal-slider-content {
  position: relative;
  max-width: 1200px;
  width: 100%;
  background: #1a1a1a;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}

.modal-close-slider {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close-slider:hover {
  background: #c9a24d;
  border-color: #c9a24d;
  transform: rotate(90deg);
}

.modal-header-slider {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header-slider h3 {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  font-family: 'Playfair Display', serif;
}

.modal-stat-badge {
  display: inline-block;
  background: linear-gradient(135deg, #c9a24d, #b0893e);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* CONTAINER DU SLIDER */
.slider-container {
  margin-bottom: 20px;
}

.ba-slider-modal {
  position: relative;
  width: 100%;
  max-width: 1000px;
  height: 600px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1a;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ba-img-modal {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

.ba-after-modal {
  clip-path: inset(0 0 0 50%);
  transition: clip-path 0.05s linear;
}

.ba-handle-modal {
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 100%;
  background: #fff;
  transform: translateX(-50%);
  z-index: 5;
  box-shadow: 0 0 20px rgba(255,255,255,0.5);
  pointer-events: none;
}

.ba-handle-modal span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  border: 3px solid #c9a24d;
  pointer-events: all;
}

.ba-handle-modal span::before,
.ba-handle-modal span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 3px solid #c9a24d;
  border-right: 3px solid #c9a24d;
}

.ba-handle-modal span::before {
  left: 10px;
  transform: translateY(-50%) rotate(-135deg);
}

.ba-handle-modal span::after {
  right: 10px;
  transform: translateY(-50%) rotate(45deg);
}

/* LABELS AVANT/APRÈS */
.ba-label-modal {
  position: absolute;
  top: 20px;
  padding: 8px 18px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  z-index: 6;
  letter-spacing: 1px;
}

.ba-label-before-modal {
  left: 20px;
}

.ba-label-after-modal {
  right: 20px;
}

/* INSTRUCTIONS */
.modal-instructions {
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.modal-instructions i {
  font-size: 1.2rem;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 220px;
  }
}

@media (max-width: 768px) {
  
  /* Filtres */
  .filters-wrapper {
    gap: 8px;
  }
  
  .filter-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
  
  .filter-btn i {
    font-size: 1rem;
  }
  
  /* Stats */
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-label {
    font-size: 0.85rem;
  }
  
  /* Masonry Grid */
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    gap: 15px;
    padding: 0 15px;
  }
  
  .masonry-item.wide {
    grid-column: span 1;
  }
  
  /* Modal Slider */
  .modal-slider-content {
    padding: 20px;
  }
  
  .modal-header-slider h3 {
    font-size: 1.3rem;
  }
  
  .ba-slider-modal {
    height: 400px;
  }
  
  .ba-handle-modal span {
    width: 40px;
    height: 40px;
  }
  
  .ba-label-modal {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  
  .modal-instructions {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  
  .masonry-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
  }
  
  .masonry-item.tall {
    grid-row: span 1;
  }
  
  .ba-slider-modal {
    height: 300px;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
}

/* =========================
   ANIMATIONS
========================= */

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

.masonry-item {
  animation: fadeInUp 0.6s ease forwards;
}

/* Délais d'animation pour effet en cascade */
.masonry-item:nth-child(1) { animation-delay: 0.1s; }
.masonry-item:nth-child(2) { animation-delay: 0.2s; }
.masonry-item:nth-child(3) { animation-delay: 0.3s; }
.masonry-item:nth-child(4) { animation-delay: 0.4s; }
.masonry-item:nth-child(5) { animation-delay: 0.5s; }
.masonry-item:nth-child(6) { animation-delay: 0.6s; }
