/**
 * ACF Icon List for Elementor — Frontend CSS
 * Plugin by elocka
 * Version: 1.0.0
 */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
.acfil-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.acfil-item {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  /* La transition par défaut est gérée par le contrôle Elementor */
}

/* ============================================================
   2. DISPOSITIONS
   ============================================================ */

/* Vertical */
.acfil-list--vertical {
  flex-direction: column;
  align-items: flex-start;
}

/* Horizontal */
.acfil-list--horizontal {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}
.acfil-list--horizontal .acfil-sep {
  margin: 0 6px;
  opacity: 0.4;
  font-size: 0.85em;
}
/* Masquer séparateur sur le dernier item */
.acfil-list--horizontal .acfil-item:last-child .acfil-sep {
  display: none;
}

/* Grille */
.acfil-list--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* override par Elementor via selector */
}

/* ============================================================
   3. POSITION ICÔNE
   ============================================================ */
.acfil-icon-pos--left .acfil-item {
  flex-direction: row;
}
.acfil-icon-pos--right .acfil-item {
  flex-direction: row-reverse;
}
.acfil-icon-pos--top .acfil-item {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* ============================================================
   4. ICÔNE & TEXTE
   ============================================================ */
.acfil-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.acfil-icon i,
.acfil-icon svg {
  display: block;
  line-height: 1;
}
.acfil-text {
  line-height: 1.4;
}

/* ============================================================
   5. NOTICE ÉDITEUR
   ============================================================ */
.acfil-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px 15px;
  color: #856404;
  font-size: 13px;
}

/* ============================================================
   6. ANIMATIONS — KEYFRAMES
   ============================================================ */

/* --- Fade In --- */
@keyframes acfil-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Slide Up --- */
@keyframes acfil-slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Slide Down --- */
@keyframes acfil-slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Slide Left --- */
@keyframes acfil-slideLeft {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --- Slide Right --- */
@keyframes acfil-slideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --- Scale In --- */
@keyframes acfil-scaleIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* --- Bounce In --- */
@keyframes acfil-bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* --- Flip X --- */
@keyframes acfil-flipX {
  from { opacity: 0; transform: perspective(400px) rotateX(90deg); }
  to   { opacity: 1; transform: perspective(400px) rotateX(0); }
}

/* --- Flip Y --- */
@keyframes acfil-flipY {
  from { opacity: 0; transform: perspective(400px) rotateY(90deg); }
  to   { opacity: 1; transform: perspective(400px) rotateY(0); }
}

/* --- Rotate In --- */
@keyframes acfil-rotateIn {
  from { opacity: 0; transform: rotate(-200deg); }
  to   { opacity: 1; transform: rotate(0); }
}

/* --- Swing --- */
@keyframes acfil-swing {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(15deg); }
  40%  { transform: rotate(-10deg); }
  60%  { transform: rotate(5deg); }
  80%  { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}

/* --- Pulse --- */
@keyframes acfil-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* --- Shake --- */
@keyframes acfil-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* --- Tada --- */
@keyframes acfil-tada {
  0%   { transform: scale(1); }
  10%, 20% { transform: scale(0.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* --- Jello --- */
@keyframes acfil-jello {
  0%, 11.1%, 100% { transform: none; }
  22.2% { transform: skewX(-12.5deg) skewY(-12.5deg); }
  33.3% { transform: skewX(6.25deg) skewY(6.25deg); }
  44.4% { transform: skewX(-3.125deg) skewY(-3.125deg); }
  55.5% { transform: skewX(1.5625deg) skewY(1.5625deg); }
  66.6% { transform: skewX(-0.78125deg) skewY(-0.78125deg); }
  77.7% { transform: skewX(0.390625deg) skewY(0.390625deg); }
  88.8% { transform: skewX(-0.1953125deg) skewY(-0.1953125deg); }
}

/* --- Head Shake --- */
@keyframes acfil-headShake {
  0%   { transform: translateX(0); }
  6.5% { transform: translateX(-6px) rotateY(-9deg); }
  18.5%{ transform: translateX(5px) rotateY(7deg); }
  31.5%{ transform: translateX(-3px) rotateY(-5deg); }
  43.5%{ transform: translateX(2px) rotateY(3deg); }
  50%  { transform: translateX(0); }
}

/* --- Rubber Band --- */
@keyframes acfil-rubberBand {
  0%   { transform: scale(1); }
  30%  { transform: scaleX(1.25) scaleY(0.75); }
  40%  { transform: scaleX(0.75) scaleY(1.25); }
  50%  { transform: scaleX(1.15) scaleY(0.85); }
  65%  { transform: scaleX(0.95) scaleY(1.05); }
  75%  { transform: scaleX(1.05) scaleY(0.95); }
  100% { transform: scale(1); }
}

/* --- Heart Beat --- */
@keyframes acfil-heartBeat {
  0%   { transform: scale(1); }
  14%  { transform: scale(1.3); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.3); }
  70%  { transform: scale(1); }
}

/* ── ICON ANIMATIONS ────────────────────── */

/* --- Spin --- */
@keyframes acfil-icon-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- Pop --- */
@keyframes acfil-icon-pop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* --- Bounce --- */
@keyframes acfil-icon-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* --- Fade --- */
@keyframes acfil-icon-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Rotate --- */
@keyframes acfil-icon-rotate {
  from { transform: rotate(-180deg); opacity: 0; }
  to   { transform: rotate(0deg); opacity: 1; }
}

/* --- Wobble --- */
@keyframes acfil-icon-wobble {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px) rotate(-5deg); }
  30%  { transform: translateX(6px) rotate(3deg); }
  45%  { transform: translateX(-4px) rotate(-3deg); }
  60%  { transform: translateX(2px) rotate(2deg); }
  75%  { transform: translateX(-1px) rotate(-1deg); }
  100% { transform: translateX(0); }
}

/* ============================================================
   7. ÉTAT INITIAL POUR ANIMATION D'ENTRÉE
      (appliqué par JS avant le déclenchement)
   ============================================================ */
.acfil-item.is-animating {
  opacity: 0;
}
.acfil-item.is-animated {
  opacity: 1;
}

/* ============================================================
   8. HOVER ANIMATIONS
   ============================================================ */

/* Scale */
.acfil-list[data-hover="scale"] .acfil-item:hover {
  transform: scale(1.03);
}

/* Lift */
.acfil-list[data-hover="lift"] .acfil-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Glow */
.acfil-list[data-hover="glow"] .acfil-item:hover {
  box-shadow: 0 0 15px 3px rgba(var(--e-global-color-accent-rgb, 99,102,241), 0.45);
}

/* Rotate (icon) */
.acfil-list[data-hover="rotate"] .acfil-item:hover .acfil-icon {
  transform: rotate(15deg);
}

/* Spin (icon) */
.acfil-list[data-hover="spin"] .acfil-item:hover .acfil-icon {
  animation: acfil-icon-spin 0.6s linear;
}

/* Shake */
.acfil-list[data-hover="shake"] .acfil-item:hover {
  animation: acfil-shake 0.5s ease;
}

/* Bounce */
.acfil-list[data-hover="bounce"] .acfil-item:hover .acfil-icon {
  animation: acfil-icon-bounce 0.6s ease;
}

/* ============================================================
   9. TYPEWRITER
   ============================================================ */
.acfil-typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: currentColor;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: acfil-blink 0.7s step-end infinite;
}

@keyframes acfil-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.acfil-typewriter-cursor.hidden {
  display: none;
}

/* ============================================================
   10. RESPONSIVE GRILLE — FALLBACKS
   ============================================================ */
@media (max-width: 1024px) {
  .acfil-list--grid {
    /* Overridé par Elementor responsive selectors */
  }
}
@media (max-width: 767px) {
  .acfil-list--horizontal {
    flex-wrap: wrap;
  }
}
