/* ============================================================
   Infinite Testimonial Layout
   ============================================================ */
.grwp-layout-infinite-testimonial {
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark {
  background: radial-gradient(circle at 20% 0%, rgba(99,102,241,.2), transparent 40%), #070a12;
  border: 1px solid rgba(129,140,248,.24);
}

.grwp-layout-infinite-testimonial.grwp-itc-light {
  background: radial-gradient(circle at 20% 0%, rgba(99,102,241,.08), transparent 40%), #f8fafc;
  border: 1px solid #dbeafe;
}

.grwp-layout-infinite-testimonial .grwp-itc-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.grwp-layout-infinite-testimonial .grwp-itc-row {
  display: flex;
  gap: 14px;
  width: max-content;
}

.grwp-layout-infinite-testimonial .grwp-itc-row-a {
  animation: grwp-itc-scroll-a 36s linear infinite;
  padding-top: 16px;
}

.grwp-layout-infinite-testimonial .grwp-itc-row-b {
  animation: grwp-itc-scroll-b 42s linear infinite;
  padding-bottom: 16px;
}

.grwp-layout-infinite-testimonial:hover .grwp-itc-row {
  animation-play-state: paused;
}

@keyframes grwp-itc-scroll-a {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes grwp-itc-scroll-b {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.grwp-layout-infinite-testimonial .grwp-itc-card {
  width: 320px;
  height: 210px;
  flex: 0 0 auto;
  border-radius: 16px;
  border: 1px solid;
  padding: 16px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  display: flex;
  flex-direction: column;
}

.grwp-layout-infinite-testimonial .grwp-itc-card .grwp-itc-text {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0;
  line-height: 1.55;
  font-size: 15px;
}

.grwp-layout-infinite-testimonial .grwp-itc-card .grwp-itc-text::-webkit-scrollbar {
  display: none;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-card {
  background: linear-gradient(145deg, rgba(15,23,42,.95), rgba(24,24,38,.92));
  border-color: rgba(148,163,184,.28);
  box-shadow: 0 8px 24px rgba(2,6,23,.35);
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-card {
  background: #ffffff;
  border-color: #dbeafe;
  box-shadow: 0 6px 20px rgba(15,23,42,.08);
}

/* ---- AI Overview Card (desktop: sidebar 30% left) ---- */
.grwp-layout-infinite-testimonial .grwp-itc-stage-inner {
  display: flex;
  gap: 16px;
  width: 100%;
}

.grwp-layout-infinite-testimonial .grwp-itc-ai-section {
  display: none;
  width: 30%;
  min-width: 240px;
  max-width: 340px;
  flex-shrink: 0;
}

.grwp-layout-infinite-testimonial .grwp-itc-scroll-section {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-scroll-section {
  background: #fff;
  border-radius: 16px;
}

.grwp-layout-infinite-testimonial .grwp-ai-overlay-card {
  height: 100%;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, #ffffff, #f7f5ff);
  box-shadow: 0 20px 45px rgba(80,40,180,.12), inset 0 1px 0 rgba(255,255,255,.8);
  position: relative;
  overflow: hidden;
  cursor: default;
}

/* purple glow at top-right */
.grwp-layout-infinite-testimonial .grwp-ai-overlay-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(124,58,237,.25), transparent 70%);
  top: -60px;
  right: -60px;
  animation: grwp-ai-pulse-glow 4s ease-in-out infinite;
  pointer-events: none;
}

/* Dark theme variant */
.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-ai-overlay-card {
  background: linear-gradient(145deg, #1e1b4b, #312e81) !important;
  box-shadow: 0 20px 45px rgba(80,40,180,.3), inset 0 1px 0 rgba(255,255,255,.08);
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-ai-overlay-card::before {
  background: radial-gradient(circle, rgba(124,58,237,.4), transparent 70%);
}

/* AI Header row */
.grwp-ai-overlay-card .ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

/* AI Icon */
.grwp-ai-overlay-card .ai-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: grwp-ai-zoom 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.grwp-ai-overlay-card .ai-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #7c3aed;
  stroke-width: 4;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 12px rgba(124,58,237,.35));
}

/* AI heading */
.grwp-ai-overlay-card .ai-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(90deg, #6d28d9, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: Arial, sans-serif;
}

/* AI Content -- 4 lines, scrollable */
.grwp-ai-overlay-card .ai-content {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
  font-family: Arial, sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 14;
  -webkit-box-orient: vertical;
  overflow-y: auto;
  max-height: 160px;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}

.grwp-ai-overlay-card .ai-content::-webkit-scrollbar {
  display: none;
}

/* Dark theme text */
.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-ai-overlay-card .ai-content {
  color: #e0e7ff;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-ai-overlay-card .ai-icon svg {
  stroke: #a78bfa;
}

/* Animations */
@keyframes grwp-ai-zoom {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes grwp-ai-pulse-glow {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.35); opacity: .85; }
}

/* ---- AI Overview Footer Card (mobile) ---- */
.grwp-ai-footer-card {
  display: none;
}

.grwp-ai-footer-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-ai-footer-header {
  color: #a5b4fc;
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-ai-footer-header {
  color: #4338ca;
}

.grwp-ai-footer-text {
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-ai-footer-text {
  color: #cbd5e1;
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-ai-footer-text {
  color: #475569;
}

/* ---- Sparkle Icon Animation ---- */
.grwp-ai-sparkle {
  animation: grwp-sparkle-pulse 2s ease-in-out infinite;
}

@keyframes grwp-sparkle-pulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}

.grwp-ai-footer-header .grwp-ai-sparkle {
  color: #6366f1;
}

.grwp-layout-infinite-testimonial .grwp-itc-card:hover {
  transform: translateY(-3px);
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-card:hover {
  border-color: rgba(167,139,250,.6);
  box-shadow: 0 12px 28px rgba(2,6,23,.5);
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(59,130,246,.18);
}

.grwp-layout-infinite-testimonial .grwp-itc-stars {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.grwp-layout-infinite-testimonial .grwp-itc-stars .grwp-star.filled {
  color: #FBBC05 !important;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-text,
.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-author strong,
.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-biz-meta strong {
  color: #f8fafc;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-author small,
.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-biz-meta span {
  color: #cbd5e1;
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-text,
.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-author strong,
.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-biz-meta strong {
  color: #0f172a;
}

.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-author small,
.grwp-layout-infinite-testimonial.grwp-itc-light .grwp-itc-biz-meta span {
  color: #475569;
}

.grwp-layout-infinite-testimonial .grwp-itc-author {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 14px;
}

.grwp-layout-infinite-testimonial .grwp-itc-author > div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.grwp-layout-infinite-testimonial .grwp-itc-author small {
  font-size: 12px;
}

.grwp-layout-infinite-testimonial .grwp-itc-footer {
  margin-top: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-footer-bottom {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-footer .grwp-powered-by {
  text-align: right !important;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-footer .grwp-powered-by .grwp-powered-text {
  color: #ffffff !important;
}

.grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-footer .grwp-powered-by .grwp-brand-link {
  background: linear-gradient(135deg, #a855f7, #c084fc, #e9d5ff) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-biz {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-biz-photo {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 1px solid rgba(148,163,184,.35) !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-biz-initials {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  font-weight: 800 !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-biz-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-biz-meta span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  font-size: 12px !important;
}

.grwp-layout-infinite-testimonial .grwp-itc-biz-meta span .grwp-star.filled {
  color: #FBBC05 !important;
}

/* ---- Desktop: show AI sidebar ---- */
@media (min-width: 761px) {
  .grwp-layout-infinite-testimonial .grwp-itc-ai-section {
    display: block;
  }

  .grwp-ai-footer-card {
    display: none !important;
  }

  .grwp-itc-mobile-ai {
    display: none;
  }
}

/* ---- Mobile: AI card between reviews & footer ---- */
@media (max-width: 760px) {
  .grwp-layout-infinite-testimonial .grwp-itc-card {
    width: 260px;
  }

  .grwp-layout-infinite-testimonial .grwp-itc-stage-inner {
    flex-direction: column;
    gap: 0;
  }

  .grwp-layout-infinite-testimonial .grwp-itc-ai-section {
    display: none !important;
  }

  .grwp-itc-mobile-ai {
    display: block;
    margin-top: 16px;
  }

  .grwp-itc-mobile-ai .grwp-ai-footer-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(80,40,180,.08);
    background: #fff;
    text-align: left;
  }

  .grwp-layout-infinite-testimonial.grwp-itc-dark .grwp-itc-mobile-ai .grwp-ai-footer-card {
    background: rgba(15,23,42,.95);
    border-color: rgba(148,163,184,.28);
    box-shadow: 0 4px 12px rgba(2,6,23,.35);
  }

  .grwp-itc-mobile-ai .grwp-ai-footer-header {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .grwp-itc-mobile-ai .grwp-ai-footer-text {
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: none;
  }

  .grwp-itc-mobile-ai .grwp-ai-footer-card.grwp-ai-expanded .grwp-ai-footer-text {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
  }

  .grwp-itc-mobile-ai .grwp-ai-read-more {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    line-height: 1;
    text-align: left;
  }

  .grwp-layout-infinite-testimonial .grwp-itc-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 16px !important;
  }

  .grwp-layout-infinite-testimonial .grwp-itc-biz {
    width: 100% !important;
  }

  .grwp-layout-infinite-testimonial .grwp-itc-footer-bottom {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .grwp-layout-infinite-testimonial .grwp-itc-footer .grwp-powered-by {
    text-align: right !important;
    font-size: 10px !important;
  }

  .grwp-layout-infinite-testimonial .grwp-leave-review-btn {
    white-space: nowrap !important;
  }
}

