* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

html, body {
  height: 100%;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a0a1f 100%);
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
  position: relative;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 50px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 45, 111, 0.15);
  transition: all 0.3s ease;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 100vw;
}

.site-header.scrolled {
  background: rgba(10, 10, 15, 0.95);
  padding: 16px 50px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.brand:hover {
  transform: scale(1.08);
}

.logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 0 20px rgba(255, 45, 111, 0.5));
  transition: filter 0.3s ease;
}

.brand:hover .logo {
  filter: drop-shadow(0 0 30px rgba(255, 45, 111, 0.7));
}

.brand-title {
  font-weight: 700;
  font-size: 1.7rem;
  background: linear-gradient(135deg, #ff2d6f 0%, #ff6b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.controls-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

#searchInput {
  padding: 14px 22px;
  border-radius: 14px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  width: 280px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

#searchInput:focus {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(255, 45, 111, 0.2);
  border-color: #ff2d6f;
  width: 340px;
  transform: translateY(-1px);
}

#searchInput::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#categoryFilter,
#typeFilter {
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  font-family: inherit;
  font-weight: 500;
}

#categoryFilter:hover,
#typeFilter:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ff2d6f;
  transform: translateY(-1px);
}

#categoryFilter:focus,
#typeFilter:focus {
  box-shadow: 0 0 0 4px rgba(255, 45, 111, 0.2);
}

#categoryFilter option,
#typeFilter option {
  background: #1a1a26;
  color: #fff;
  padding: 12px;
  font-weight: 500;
}

/* HERO */
#hero {
  position: relative;
  height: 80vh;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(10, 10, 15, 0.85)),
              url('/assets/img/banner.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(10, 10, 15, 0.85) 100%);
}

#hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 45, 111, 0.1) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.hero-overlay {
  position: relative;
  z-index: 1;
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: blur(15px);
  padding: 60px 90px;
  border-radius: 28px;
  text-align: center;
  animation: fadeInUp 1s ease;
  border: 1.5px solid rgba(255, 45, 111, 0.25);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  max-width: 92%;
}

.hero-overlay h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: -1px;
}

.hero-overlay h1 span {
  background: linear-gradient(135deg, #ff2d6f 0%, #ff6b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-overlay p {
  color: #d5ddf0;
  margin-bottom: 0;
  font-size: 1.2rem;
  line-height: 1.6;
  font-weight: 400;
}

/* SECTION */
.section-title {
  font-size: 1.8rem;
  margin: 50px 50px 25px;
  font-weight: 600;
  color: #e8e8e8;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
}

/* GRID - Ratio 40x60cm (2:3) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px;
  padding: 25px 50px 100px;
}

.video-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(20, 20, 30, 0.65);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 45, 111, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.video-card:hover::before {
  opacity: 1;
}

.video-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 25px 60px rgba(255, 45, 111, 0.25);
  border-color: rgba(255, 45, 111, 0.4);
}

/* Format affiche 40x60 = ratio 2:3 exact */
.thumb {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.video-card:hover .thumb {
  transform: scale(1.05);
}

.card-body {
  padding: 14px;
  text-align: left;
  position: relative;
  z-index: 2;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.8rem;
  color: #bbb;
  display: inline-block;
  background: rgba(255, 45, 111, 0.18);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.episode-count {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 6px;
  font-weight: 400;
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff2d6f 0%, #ff6b9d 100%);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(255, 45, 111, 0.4);
}

.video-card.loading {
  pointer-events: none;
}

.video-card.loading .thumb {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 25%, 
    rgba(255, 255, 255, 0.12) 50%, 
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.site-footer {
  text-align: center;
  padding: 25px 0;
  color: #999;
  background: rgba(10, 10, 15, 0.95);
  border-top: 1px solid rgba(255, 45, 111, 0.15);
  backdrop-filter: blur(15px);
  font-size: 0.95rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state {
  text-align: center;
  padding: 100px 50px;
  color: #888;
  grid-column: 1 / -1;
}

.empty-state h3 {
  font-size: 2rem;
  margin-bottom: 14px;
  color: #aaa;
}

.empty-state p {
  font-size: 1.15rem;
}

/* RESPONSIVE */
@media (max-width: 1400px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 1200px) {
  .site-header {
    padding: 20px 40px;
    max-width: 100vw;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 22px;
    padding: 20px 40px 80px;
  }
  
  .section-title {
    margin: 40px 40px 20px;
    font-size: 1.6rem;
  }
}

@media (max-width: 1024px) {
  .logo {
    height: 46px;
  }
  
  .brand-title {
    font-size: 1.5rem;
  }
  
  #searchInput {
    width: 220px;
  }
  
  #searchInput:focus {
    width: 260px;
  }
  
  .hero-overlay {
    padding: 50px 60px;
  }
  
  .hero-overlay h1 {
    font-size: 2.8rem;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .site-header {
    flex-wrap: wrap;
    padding: 12px 12px;
    gap: 10px;
    max-width: 100vw;
  }

  .brand {
    order: 1;
    flex-shrink: 0;
  }
  
  .logo {
    height: 40px;
  }
  
  .brand-title {
    font-size: 1.35rem;
  }

  .controls-top {
    width: 100%;
    order: 3;
    gap: 8px;
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  #searchInput {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    padding: 14px 18px;
    height: 50px;
  }
  
  #searchInput:focus {
    width: 100%;
  }

  #categoryFilter,
  #typeFilter {
    font-size: 15px;
    padding: 14px 16px;
    height: 52px;
    min-height: 52px;
    max-width: 100%;
    min-width: 0;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
  }
  
  /* Grille pour les 2 filtres côte à côte */
  .controls-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  #categoryFilter {
    flex: 1 1 calc(50% - 4px);
  }
  
  #typeFilter {
    flex: 1 1 calc(50% - 4px);
  }

  #hero {
    height: 65vh;
    width: 100%;
    max-width: 100vw;
  }

  .hero-overlay {
    padding: 36px 24px;
    max-width: 92%;
  }

  .hero-overlay h1 {
    font-size: 2.1rem;
  }
  
  .hero-overlay p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.45rem;
    margin: 30px 16px 14px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    padding: 16px 16px 70px;
    width: 100%;
    max-width: 100vw;
  }

  .card-body {
    padding: 11px;
  }

  .card-title {
    font-size: 0.88rem;
  }

  .card-meta {
    font-size: 0.73rem;
    padding: 3px 8px;
  }
  
  .card-badge {
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 14px 16px;
  }
  
  .logo {
    height: 38px;
  }
  
  .brand-title {
    font-size: 1.3rem;
  }
  
  #hero {
    height: 55vh;
  }
  
  .hero-overlay {
    padding: 35px 24px;
  }
  
  .hero-overlay h1 {
    font-size: 2rem;
  }
  
  .hero-overlay p {
    font-size: 1rem;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 14px;
    padding: 16px 16px 60px;
  }
  
  .section-title {
    margin: 28px 16px 14px;
    font-size: 1.4rem;
  }
  
  .video-card {
    border-radius: 14px;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .card-title {
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .brand-title {
    display: none;
  }
  
  .site-header {
    padding: 10px 10px;
  }
  
  .logo {
    height: 36px;
  }
  
  #searchInput {
    font-size: 16px;
    padding: 10px 14px;
  }
  
  #categoryFilter,
  #typeFilter {
    font-size: 14px;
    padding: 10px 10px;
  }
  
  #hero {
    height: 50vh;
  }

  .hero-overlay {
    padding: 28px 18px;
  }

  .hero-overlay h1 {
    font-size: 1.7rem;
  }
  
  .hero-overlay p {
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.3rem;
    margin: 26px 12px 12px;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
    padding: 14px 12px 55px;
  }
  
  .video-card {
    border-radius: 12px;
  }
  
  .card-body {
    padding: 9px;
  }
  
  .card-title {
    font-size: 0.83rem;
  }
  
  .card-meta {
    font-size: 0.68rem;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px 12px 50px;
  }
  
  .hero-overlay h1 {
    font-size: 1.6rem;
  }
  
  .hero-overlay p {
    font-size: 0.9rem;
  }
}

/* Optimisation pour très petits écrans */
@media (max-width: 320px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .card-title {
    font-size: 0.78rem;
  }
  
  .card-meta {
    font-size: 0.65rem;
  }
}