/* ==========================================================================
   WEBMARKETING.CSS — Command Center Bento
   ========================================================================== */

/* ==========================================================================
   VARIANTE FOND WEBMARKETING
   ========================================================================== */
.at-presta--webmarketing .at-presta-hero-bg {
  background:
    radial-gradient(rgba(1, 136, 73, 0.12) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(rgba(1, 136, 73, 0.06) 1px, transparent 1px) 12px 12px / 24px 24px,
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 100px,
      rgba(1, 136, 73, 0.04) 100px,
      rgba(1, 136, 73, 0.06) 101px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 100px,
      rgba(139, 92, 246, 0.03) 100px,
      rgba(139, 92, 246, 0.05) 101px
    ),
    linear-gradient(160deg, rgba(1,136,73,0.15) 0%, rgba(139,92,246,0.08) 40%, transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* ==========================================================================
   COMMAND CENTER
   ========================================================================== */
.at-presta-command {
  position: relative;
  width: 100%;
  max-width: 380px;
  perspective: 1000px;
}

.at-presta-command-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130%;
  height: 130%;
  background: radial-gradient(ellipse at center, 
    rgba(1, 136, 73, 0.20) 0%,
    rgba(139, 92, 246, 0.10) 50%,
    transparent 70%
  );
  filter: blur(50px);
  animation: at-command-glow-pulse 4s ease-in-out infinite;
  z-index: -1;
}

@keyframes at-command-glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.05); }
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.at-presta-command-container {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.95) 100%);
  border: 2px solid #1a1a1a;
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.02),
    0 12px 24px rgba(0,0,0,0.06),
    0 24px 48px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
  transform: rotateY(-5deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

.at-presta-command:hover .at-presta-command-container {
  transform: rotateY(-2deg) rotateX(1deg);
}

/* ==========================================================================
   HEADER DARK
   ========================================================================== */
.at-presta-command-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.at-presta-command-dots {
  display: flex;
  gap: 6px;
}

.at-presta-command-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.at-presta-command-dots span:nth-child(1) { background: #f87171; }
.at-presta-command-dots span:nth-child(2) { background: #fbbf24; }
.at-presta-command-dots span:nth-child(3) { background: #34d399; }

.at-presta-command-title {
  flex: 1;
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
}

.at-presta-command-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #22c55e;
}

.at-presta-command-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: at-command-status-pulse 1.5s ease-in-out infinite;
}

@keyframes at-command-status-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* Body */
.at-presta-command-body {
  position: relative;
  padding: 14px;
}

/* ==========================================================================
   BENTO GRID
   ========================================================================== */
.at-presta-command-bento {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, auto);
  gap: 10px;
  z-index: 1;
}

/* ==========================================================================
   WIDGETS BASE
   ========================================================================== */
.at-presta-command-widget {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  opacity: 0;
  transform: translateY(10px);
  animation: at-command-widget-appear 0.5s ease forwards;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.at-presta-command-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

@keyframes at-command-widget-appear {
  to { opacity: 1; transform: translateY(0); }
}

.at-presta-command-widget-icon {
  font-size: 18px;
  line-height: 1;
}

.at-presta-command-widget-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--trafic-dark);
  opacity: 0.5;
}

.at-presta-command-widget-value {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--trafic-dark);
  line-height: 1;
}

.at-presta-command-widget-sub {
  font-size: 9px;
  color: var(--trafic-dark);
  opacity: 0.4;
}

/* ==========================================================================
   WIDGET VARIANTS - POSITIONS BENTO
   ========================================================================== */

/* SEO : Grand bloc gauche (2 colonnes, 2 lignes) */
.at-presta-command-widget--seo {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  animation-delay: 0.2s;
}

.at-presta-command-widget--seo.at-presta-command-widget--large {
  padding: 14px;
}

.at-presta-command-widget--seo .at-presta-command-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.at-presta-command-widget--seo .at-presta-command-widget-value {
  font-size: 32px;
  background: linear-gradient(135deg, var(--trafic-cta), #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.at-presta-command-widget--seo .at-presta-command-widget-bar {
  margin-top: 8px;
}

.at-presta-command-widget--seo .at-presta-command-widget-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  margin-top: 8px;
}

.at-presta-command-widget--seo .at-presta-command-widget-chart span {
  flex: 1;
  height: var(--h);
  background: linear-gradient(180deg, var(--trafic-cta), rgba(1,136,73,0.3));
  border-radius: 2px;
  transform-origin: bottom;
  transform: scaleY(0);
  animation: at-command-bar-grow 0.5s ease forwards;
}

.at-presta-command-widget--seo .at-presta-command-widget-chart span:nth-child(1) { animation-delay: 0.8s; }
.at-presta-command-widget--seo .at-presta-command-widget-chart span:nth-child(2) { animation-delay: 0.9s; }
.at-presta-command-widget--seo .at-presta-command-widget-chart span:nth-child(3) { animation-delay: 1s; }
.at-presta-command-widget--seo .at-presta-command-widget-chart span:nth-child(4) { animation-delay: 1.1s; }
.at-presta-command-widget--seo .at-presta-command-widget-chart span:nth-child(5) { animation-delay: 1.2s; }

@keyframes at-command-bar-grow {
  to { transform: scaleY(1); }
}

/* SEA : Petit bloc haut milieu */
.at-presta-command-widget--sea {
  grid-column: 3;
  grid-row: 1;
  animation-delay: 0.3s;
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* SMA : Petit bloc haut droite */
.at-presta-command-widget--sma {
  grid-column: 4;
  grid-row: 1;
  animation-delay: 0.4s;
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* ROI : Bloc dominant (2 colonnes, 2 lignes) */
.at-presta-command-widget--roi {
  grid-column: 3 / 5;
  grid-row: 2 / 4;
  animation-delay: 0.8s;
  text-align: center;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(1,136,73,0.08) 0%, rgba(34,197,94,0.04) 100%);
  border: 2px solid rgba(1,136,73,0.2);
  overflow: hidden;
}

.at-presta-command-widget--roi .at-presta-command-widget-value {
  font-size: 26px;
  background: linear-gradient(135deg, var(--trafic-cta), #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  z-index: 2;
}

.at-presta-command-widget--roi .at-presta-command-widget-icon {
  font-size: 28px;
  position: relative;
  z-index: 2;
}

.at-presta-command-widget--roi .at-presta-command-widget-label {
  position: relative;
  z-index: 2;
}

/* Glow interne ROI */
.at-presta-command-roi-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at center, rgba(1,136,73,0.15) 0%, transparent 70%);
  animation: at-command-roi-glow 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes at-command-roi-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Ring animé ROI */
.at-presta-command-roi-ring {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 1;
}

.at-presta-command-roi-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.at-presta-command-roi-ring-bg {
  fill: none;
  stroke: rgba(1,136,73,0.1);
  stroke-width: 3;
}

.at-presta-command-roi-ring-fill {
  fill: none;
  stroke: var(--trafic-cta);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: at-command-roi-ring-fill 2s ease-out forwards 1.2s;
}

@keyframes at-command-roi-ring-fill {
  to { stroke-dashoffset: 53; } /* ~80% */
}

/* UX : Petit bloc gauche milieu */
.at-presta-command-widget--ux {
  grid-column: 1;
  grid-row: 3;
  animation-delay: 0.5s;
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* Tracking : Petit bloc bas gauche */
.at-presta-command-widget--tracking {
  grid-column: 2;
  grid-row: 3;
  animation-delay: 0.6s;
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* Automation : Bloc horizontal bas (4 colonnes) */
.at-presta-command-widget--automation {
  grid-column: 1 / 5;
  grid-row: 4;
  animation-delay: 0.7s;
  padding: 12px 14px;
}

.at-presta-command-widget--automation .at-presta-command-widget-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.at-presta-command-widget--automation .at-presta-command-widget-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.at-presta-command-widget--automation .at-presta-command-widget-value {
  font-size: 18px;
}

.at-presta-command-widget--automation .at-presta-command-widget-sub {
  margin-left: auto;
}

.at-presta-command-widget--automation .at-presta-command-widget-bar--full {
  margin-top: 10px;
}

/* ==========================================================================
   BARRE DE PROGRESSION
   ========================================================================== */
.at-presta-command-widget-bar {
  height: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.at-presta-command-widget-bar--full {
  height: 6px;
  border-radius: 3px;
}

.at-presta-command-widget-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--trafic-cta), #22c55e);
  border-radius: 2px;
  animation: at-command-bar-fill 1s ease forwards 1.5s;
}

@keyframes at-command-bar-fill {
  to { width: var(--fill); }
}

/* ==========================================================================
   CASCADE LUMINEUSE
   ========================================================================== */
.at-presta-command-widget--seo {
  animation: at-command-widget-appear 0.5s ease forwards 0.2s, at-command-cascade 6s ease-in-out infinite 3s;
}
.at-presta-command-widget--sea {
  animation: at-command-widget-appear 0.5s ease forwards 0.3s, at-command-cascade 6s ease-in-out infinite 3.3s;
}
.at-presta-command-widget--sma {
  animation: at-command-widget-appear 0.5s ease forwards 0.4s, at-command-cascade 6s ease-in-out infinite 3.6s;
}
.at-presta-command-widget--ux {
  animation: at-command-widget-appear 0.5s ease forwards 0.5s, at-command-cascade 6s ease-in-out infinite 3.9s;
}
.at-presta-command-widget--tracking {
  animation: at-command-widget-appear 0.5s ease forwards 0.6s, at-command-cascade 6s ease-in-out infinite 4.2s;
}
.at-presta-command-widget--automation {
  animation: at-command-widget-appear 0.5s ease forwards 0.7s, at-command-cascade 6s ease-in-out infinite 4.5s;
}
.at-presta-command-widget--roi {
  animation: at-command-widget-appear 0.5s ease forwards 0.8s, at-command-cascade-roi 6s ease-in-out infinite 5s;
}

@keyframes at-command-cascade {
  0%, 5% { box-shadow: 0 2px 8px rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.06); }
  10%, 18% { box-shadow: 0 0 20px rgba(1,136,73,0.3); border-color: var(--trafic-cta); }
  25%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.06); }
}

@keyframes at-command-cascade-roi {
  0%, 5% { box-shadow: none; }
  10%, 30% { box-shadow: 0 0 40px rgba(1,136,73,0.5), 0 0 60px rgba(1,136,73,0.3); }
  40%, 100% { box-shadow: none; }
}

/* ==========================================================================
   REFLET
   ========================================================================== */
.at-presta-command-reflection {
  position: absolute;
  bottom: -50%;
  left: 5%;
  right: 5%;
  height: 50%;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, transparent 100%);
  transform: rotateX(180deg) rotateY(-5deg);
  opacity: 0.3;
  filter: blur(3px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 50%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 50%);
  pointer-events: none;
}

/* ==========================================================================
   ÉLÉMENTS ORBITANTS
   ========================================================================== */
.at-presta-command-orbit {
  position: absolute;
  inset: -30px;
  pointer-events: none;
}

.at-presta-command-orbit-item {
  position: absolute;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  font-size: 20px;
  animation: at-command-orbit-float 4s ease-in-out infinite;
}

.at-presta-command-orbit-item--tr { top: 5%; right: -12%; animation-delay: 0s; }
.at-presta-command-orbit-item--ml { top: 40%; left: -12%; animation-delay: 1s; }
.at-presta-command-orbit-item--bl { bottom: 8%; left: -14%; animation-delay: 2s; }
.at-presta-command-orbit-item--br { bottom: 5%; right: -10%; animation-delay: 2.5s; }

@keyframes at-command-orbit-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(3deg); }
  75% { transform: translateY(4px) rotate(-2deg); }
}

.at-presta-command-orbit-item--tag {
  width: auto;
  padding: 0 14px;
  min-width: 44px;
}

.at-presta-command-orbit-item--tag span {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--trafic-cta);
}

.at-presta-command-orbit-item--img {
  width: 52px;
  height: 52px;
  padding: 6px;
  background: #fff;
}

.at-presta-command-orbit-item--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   NOTIFICATIONS FLOTTANTES
   ========================================================================== */
.at-presta-command-notif {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  font-size: 12px;
  font-weight: 600;
  color: var(--trafic-dark);
  opacity: 0;
  animation: at-command-notif-appear 0.5s ease forwards, at-command-notif-float 3s ease-in-out infinite;
}

.at-presta-command-notif--tl { top: 8%; left: -25%; animation-delay: 1.5s, 2s; }
.at-presta-command-notif--mr { top: 45%; right: -24%; animation-delay: 2.2s, 2.7s; }

@keyframes at-command-notif-appear { to { opacity: 1; } }
@keyframes at-command-notif-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.at-presta-command-notif-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--trafic-cta), #22c55e);
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
}

.at-presta-command-notif-text {
  white-space: nowrap;
}

/* ==========================================================================
   A11Y : Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .at-presta-command-glow,
  .at-presta-command-status-dot,
  .at-presta-command-line,
  .at-presta-command-roi-glow,
  .at-presta-command-orbit-item,
  .at-presta-command-notif {
    animation: none;
  }

  .at-presta-command-widget {
    opacity: 1;
    transform: none;
  }

  .at-presta-command-widget--seo,
  .at-presta-command-widget--sea,
  .at-presta-command-widget--sma,
  .at-presta-command-widget--ux,
  .at-presta-command-widget--tracking,
  .at-presta-command-widget--automation,
  .at-presta-command-widget--roi {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .at-presta-command-widget-bar-fill {
    width: var(--fill);
    animation: none;
  }

  .at-presta-command-roi-ring-fill {
    stroke-dashoffset: 53;
    animation: none;
  }

  .at-presta-command-widget--seo .at-presta-command-widget-chart span {
    transform: scaleY(1);
    animation: none;
  }

  .at-presta-command-line,
  .at-presta-command-notif {
    opacity: 1;
  }

  .at-presta-command-roi-glow {
    opacity: 0.5;
  }
}
