/* ============================================
   APPSM - PAGE MÉDIAS PREMIUM
   Fichier: css/medias.css
============================================ */

/* ============================================
   1. SECTIONS
============================================ */
.med-section {
  padding: 80px 0;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 120px;
}

.med-section-white {
  background: var(--white);
}

.med-section-gray {
  background: linear-gradient(135deg, #ede7f2 0%, #e4daee 100%);
}

.med-section::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(232, 103, 42, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* ============================================
   2. INTRO + STATS
============================================ */
.med-intro-header {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.med-intro-header .section-desc strong {
  color: var(--purple);
  font-weight: 700;
}

/* Stats en bas de l'intro */
.med-stats {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.med-stat-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 25px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 25px rgba(74, 30, 92, 0.1);
  transition: all 0.4s ease;
  border: 1px solid rgba(91, 45, 142, 0.08);
  min-width: 180px;
}

.med-stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(232, 103, 42, 0.2);
  border-color: transparent;
}

.med-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.4s ease;
  box-shadow: 0 5px 15px rgba(91, 45, 142, 0.3);
}

.med-stat-item:hover .med-stat-icon {
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  transform: rotate(360deg);
  box-shadow: 0 5px 15px rgba(232, 103, 42, 0.4);
}

.med-stat-info {
  display: flex;
  flex-direction: column;
}

.med-stat-num {
  font-family: "Poppins", sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
}

.med-stat-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 3px;
}

/* ============================================
   3. FILTRES
============================================ */
.med-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.med-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.4s ease;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 5px 15px rgba(74, 30, 92, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.med-filter-btn i {
  font-size: 16px;
  color: var(--orange);
  transition: color 0.3s ease;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(232, 103, 42, 0.15);
  color: var(--orange);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.3s ease;
}

.med-filter-btn:hover {
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  color: var(--white);
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(91, 45, 142, 0.3);
}

.med-filter-btn:hover i {
  color: #ffb84d;
}

.med-filter-btn:hover .filter-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.med-filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(232, 103, 42, 0.5);
}

.med-filter-btn.active i {
  color: var(--white);
}

.med-filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

/* ============================================
   4. COMPTEUR
============================================ */
.med-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(91, 45, 142, 0.08);
  color: var(--purple);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 auto 30px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.med-count-wrapper {
  text-align: center;
}

.med-count i {
  color: var(--orange);
}

.med-count strong {
  color: var(--orange);
  font-weight: 800;
  font-size: 15px;
}

/* ============================================
   5. LOADER
============================================ */
.med-loader {
  text-align: center;
  padding: 80px 20px;
  color: var(--purple);
}

.loader-spinner {
  display: inline-block;
  width: 60px;
  height: 60px;
  border: 5px solid rgba(91, 45, 142, 0.1);
  border-left-color: var(--orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.med-loader p {
  font-size: 15px;
  color: var(--gray-500);
  margin: 0;
  font-weight: 500;
}

/* ============================================
   6. GRILLE MÉDIAS
============================================ */
.med-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.med-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(74, 30, 92, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  animation: fadeInCard 0.6s ease-out forwards;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(91, 45, 142, 0.05);
  position: relative;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.med-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(74, 30, 92, 0.25);
  border-color: transparent;
}

/* Image de couverture */
.med-card-cover {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--purple) 0%, #4a1e5c 100%);
}

.med-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease;
}

.med-card:hover .med-card-cover img {
  transform: scale(1.15);
  filter: brightness(1.1);
}

/* Overlay */
.med-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(74, 30, 92, 0) 0%,
    rgba(74, 30, 92, 0.3) 60%,
    rgba(74, 30, 92, 0.9) 100%
  );
  opacity: 0.5;
  transition: opacity 0.5s ease;
}

.med-card:hover .med-card-overlay {
  opacity: 1;
  background: linear-gradient(
    to bottom,
    rgba(232, 103, 42, 0.1) 0%,
    rgba(74, 30, 92, 0.4) 50%,
    rgba(74, 30, 92, 0.95) 100%
  );
}

/* Badge */
.med-card-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 7px 15px;
  border-radius: 50px;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Poppins", sans-serif;
}

.med-card-badge.badge-photos {
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
}

.med-card-badge.badge-video {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.med-card-badge i {
  font-size: 12px;
}

/* Icône play centrale (vidéos) */
.med-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e74c3c;
  z-index: 3;
  transition: all 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: playPulse 2s ease-in-out infinite;
}

@keyframes playPulse {
  0%,
  100% {
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  50% {
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.4),
      0 0 0 15px rgba(255, 255, 255, 0);
  }
}

.med-card:hover .med-card-play {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--orange);
  color: var(--white);
  animation: none;
  box-shadow: 0 15px 40px rgba(232, 103, 42, 0.6);
}

.med-card-play i {
  font-size: 26px;
  margin-left: 4px;
}

/* Contenu carte */
.med-card-content {
  padding: 22px 22px 20px;
  border-top: 4px solid var(--orange);
  transition: border-color 0.4s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.med-card-content::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 0;
  height: 4px;
  background: var(--purple);
  transition: width 0.6s ease;
}

.med-card:hover .med-card-content::before {
  width: 100%;
}

.med-card-title {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.4;
  transition: color 0.4s ease;
}

.med-card:hover .med-card-title {
  color: var(--purple);
}

.med-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: auto;
}

.med-card-date i {
  color: var(--orange);
  font-size: 12px;
}

/* ============================================
   7. BOUTON VOIR PLUS
============================================ */
.med-load-more-wrapper {
  text-align: center;
  margin-top: 30px;
  position: relative;
  z-index: 2;
}

.med-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 40px;
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 10px 25px rgba(91, 45, 142, 0.4);
  font-family: "Poppins", sans-serif;
}

.med-load-more-btn:hover {
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(232, 103, 42, 0.5);
}

.med-load-more-btn i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.med-load-more-btn:hover i {
  transform: rotate(90deg);
}

/* ============================================
   8. MESSAGE VIDE
============================================ */
.med-empty {
  text-align: center;
  padding: 70px 30px;
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(74, 30, 92, 0.1);
  border: 1px dashed rgba(91, 45, 142, 0.2);
}

.med-empty-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 25px;
  background: linear-gradient(
    135deg,
    var(--purple) 0%,
    var(--purple-light) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 42px;
  box-shadow: 0 10px 30px rgba(91, 45, 142, 0.4);
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.med-empty h3 {
  font-family: "Poppins", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.med-empty p {
  font-size: 15px;
  color: var(--gray-500);
  line-height: 1.7;
  margin: 0;
}

/* ============================================
   9. MODAL (Photos + Vidéos)
============================================ */
.med-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.med-modal.active {
  display: flex;
}

.med-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.med-modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.med-modal-close {
  position: absolute;
  top: -55px;
  right: 0;
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  font-size: 18px;
  backdrop-filter: blur(10px);
}

.med-modal-close:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: rotate(90deg);
  box-shadow: 0 8px 20px rgba(232, 103, 42, 0.5);
}

.med-modal-header {
  color: var(--white);
  text-align: center;
  margin-bottom: 25px;
  padding: 0 60px;
}

.med-modal-header h3 {
  font-family: "Poppins", sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px 0;
}

#photo-modal-counter {
  display: inline-block;
  padding: 5px 15px;
  background: linear-gradient(
    135deg,
    var(--orange) 0%,
    var(--orange-dark) 100%
  );
  color: var(--white);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 5px 15px rgba(232, 103, 42, 0.4);
}

.med-modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

/* Modal Photos */
#photo-modal-image {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.med-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 55px;
  height: 55px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  backdrop-filter: blur(10px);
  font-size: 18px;
}

.med-modal-nav:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 20px rgba(232, 103, 42, 0.5);
}

.med-modal-prev {
  left: 20px;
}
.med-modal-next {
  right: 20px;
}

/* Miniatures */
.med-modal-thumbnails {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
  max-height: 110px;
  overflow-y: auto;
  padding: 5px;
}

.med-modal-thumb {
  width: 80px;
  height: 55px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.med-modal-thumb:hover {
  opacity: 0.85;
}

.med-modal-thumb.active {
  opacity: 1;
  border-color: var(--orange);
  transform: scale(1.08);
  box-shadow: 0 5px 15px rgba(232, 103, 42, 0.5);
}

.med-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Vidéo */
.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   10. RESPONSIVE
============================================ */
@media (max-width: 1024px) {
  .med-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .med-stats {
    gap: 15px;
  }

  .med-stat-item {
    min-width: 150px;
    padding: 15px 20px;
  }
}

@media (max-width: 768px) {
  .med-section {
    padding: 60px 0;
  }

  .med-card-cover {
    height: 200px;
  }

  .med-filter-btn {
    padding: 10px 18px;
    font-size: 12px;
  }

  .med-filter-btn span:not(.filter-count) {
    display: none;
  }

  .med-modal {
    padding: 15px;
  }

  .med-modal-header h3 {
    font-size: 18px;
  }

  .med-modal-nav {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .med-grid {
    grid-template-columns: 1fr;
  }

  .med-card-cover {
    height: 220px;
  }

  .med-modal-close {
    top: -45px;
  }

  .med-modal-thumbnails {
    display: none;
  }

  .med-stats {
    flex-direction: column;
    align-items: center;
  }

  .med-stat-item {
    width: 100%;
    max-width: 280px;
  }
}
