 /* =============================================
   SAVEURS APP — Cards & Filtres
   Fichier : assets/css/cards.css
   Codé par : Personne 2
   ============================================= */


/* ─────────────────────────────────────────────
   1. SECTION RECETTES & GRILLE
───────────────────────────────────────────── */
.recipes-section {
  margin-top: 20px;
  padding-bottom: 40px;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 16px;
}


/* ─────────────────────────────────────────────
   2. CARD RECETTE
───────────────────────────────────────────── */
.recipe-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}


/* ── Image / Zone visuelle ── */
.card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.recipe-card:hover .card-image img {
  transform: scale(1.06);
}

/* Fallback si image ne charge pas */
.card-image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
}

/* Overlay dégradé sur l'image */
.card-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}

/* Badge catégorie positionné sur l'image */
.card-category-badge {
  position: absolute;
  bottom: 10px;
  left: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Bouton favori sur l'image */
.card-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
}

.card-fav-btn:hover {
  transform: scale(1.15);
  background: #FFFFFF;
}

.card-fav-btn.active {
  background: var(--red);
  animation: pulse 0.3s ease;
}


/* ── Contenu de la card ── */
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
  font-family: var(--font-display);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Étoiles */
.card-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

.card-stars {
  color: var(--yellow);
  font-size: 12px;
  letter-spacing: 1px;
}

.card-rating-value {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}

/* Infos rapides */
.card-infos {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-info-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-sub);
}

.card-info-item span:first-child {
  font-size: 13px;
}

/* Badge difficulté */
.card-difficulty {
  margin-bottom: 14px;
}

/* Bouton voir recette */
.card-btn {
  margin-top: auto;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  border: none;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.card-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.card-btn-arrow {
  transition: transform 0.2s ease;
}

.card-btn:hover .card-btn-arrow {
  transform: translateX(4px);
}


/* ─────────────────────────────────────────────
   3. ÉTAT VIDE (aucun résultat)
───────────────────────────────────────────── */
.empty-state {
  display: none;
  text-align: center;
  padding: 80px 24px;
  animation: fadeIn 0.3s ease;
}

.empty-state.visible {
  display: block;
}

.empty-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  font-family: var(--font-display);
}

.empty-sub {
  font-size: 14px;
  color: var(--text-muted);
}


/* ─────────────────────────────────────────────
   4. ANIMATION D'APPARITION DES CARDS
───────────────────────────────────────────── */
.recipe-card {
  animation: cardAppear 0.4s ease both;
}

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

/* Décalage d'animation pour chaque card */
.recipe-card:nth-child(1)  { animation-delay: 0.05s; }
.recipe-card:nth-child(2)  { animation-delay: 0.10s; }
.recipe-card:nth-child(3)  { animation-delay: 0.15s; }
.recipe-card:nth-child(4)  { animation-delay: 0.20s; }
.recipe-card:nth-child(5)  { animation-delay: 0.25s; }
.recipe-card:nth-child(6)  { animation-delay: 0.30s; }
.recipe-card:nth-child(7)  { animation-delay: 0.35s; }
.recipe-card:nth-child(8)  { animation-delay: 0.40s; }
.recipe-card:nth-child(9)  { animation-delay: 0.45s; }
.recipe-card:nth-child(10) { animation-delay: 0.50s; }


/* ─────────────────────────────────────────────
   5. RESPONSIVE CARDS
───────────────────────────────────────────── */

/* Tablette */
@media (max-width: 900px) {
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Mobile large */
@media (max-width: 768px) {
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .card-image {
    height: 150px;
  }

  .card-body {
    padding: 14px;
  }

  .card-title {
    font-size: 14px;
  }
}

/* Mobile petit */
@media (max-width: 480px) {
  .recipes-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card-image {
    height: 200px;
  }

  .card-infos {
    gap: 8px;
  }
}
