/* anantys-rating.css — Rating widget + hero KPI stars
 *
 * Two explicit theme variants: --dark and --light.
 * Callers pass rating_theme via data-theme attribute.
 * Base styles are structural only — all colors come from the variant.
 */

/* ─── Base structure (no colors) ─── */

.anantys-rating {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.anantys-rating-stars {
  display: inline-flex;
  gap: 2px;
  cursor: pointer;
}

.anantys-rating-star {
  width: 28px;
  height: 28px;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.anantys-rating-star:hover {
  transform: scale(1.15);
}

.anantys-rating-star svg {
  width: 100%;
  height: 100%;
  display: block;
}

.anantys-rating-star .star-bg {
  transition: fill 0.2s ease;
}

.anantys-rating-star .star-stroke {
  fill: none;
  stroke-width: 1.5;
}

.anantys-rating-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anantys-rating-value {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.anantys-rating-count {
  font-size: 12px;
}

.anantys-rating-thanks {
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.anantys-rating-thanks.visible {
  opacity: 1;
}

/* ─── Dark variant (dark bg, white text — hero, dark sections) ─── */

.anantys-rating--dark .star-bg {
  fill: rgba(255, 255, 255, 0.12);
}

.anantys-rating--dark .anantys-rating-star.filled .star-bg {
  fill: hsl(165, 100%, 42%);
}

.anantys-rating--dark .star-stroke {
  stroke: hsl(165, 60%, 35%);
}

.anantys-rating--dark .anantys-rating-star.filled .star-stroke {
  stroke: hsl(165, 100%, 32%);
}

.anantys-rating--dark .anantys-rating-stars:hover .anantys-rating-star.hover-fill .star-bg {
  fill: hsl(165, 80%, 50%);
}

.anantys-rating--dark .anantys-rating-stars:hover .anantys-rating-star:not(.hover-fill) .star-bg {
  fill: rgba(255, 255, 255, 0.08);
}

.anantys-rating--dark .anantys-rating-value {
  color: rgba(255, 255, 255, 0.9);
}

.anantys-rating--dark .anantys-rating-count {
  color: rgba(255, 255, 255, 0.45);
}

.anantys-rating--dark .anantys-rating-thanks {
  color: hsl(165, 100%, 42%);
}

/* ─── Light variant (light bg, dark text — main content, stock pages) ─── */

.anantys-rating--light .star-bg {
  fill: rgba(0, 0, 0, 0.08);
}

.anantys-rating--light .anantys-rating-star.filled .star-bg {
  fill: hsl(165, 100%, 38%);
}

.anantys-rating--light .star-stroke {
  stroke: hsl(165, 40%, 55%);
}

.anantys-rating--light .anantys-rating-star.filled .star-stroke {
  stroke: hsl(165, 80%, 30%);
}

.anantys-rating--light .anantys-rating-stars:hover .anantys-rating-star.hover-fill .star-bg {
  fill: hsl(165, 80%, 45%);
}

.anantys-rating--light .anantys-rating-stars:hover .anantys-rating-star:not(.hover-fill) .star-bg {
  fill: rgba(0, 0, 0, 0.05);
}

.anantys-rating--light .anantys-rating-value {
  color: #111827;
}

.anantys-rating--light .anantys-rating-count {
  color: #6b7280;
}

.anantys-rating--light .anantys-rating-thanks {
  color: hsl(165, 80%, 32%);
}

/* ─── Compact modifier (combinable with any theme) ─── */

.anantys-rating--compact {
  padding: 10px 0;
  gap: 8px;
}

.anantys-rating--compact .anantys-rating-star {
  width: 22px;
  height: 22px;
}

.anantys-rating--compact .anantys-rating-value {
  font-size: 13px;
}

.anantys-rating--compact .anantys-rating-count {
  font-size: 11px;
}

/* ─── Feedback card (bottom of landing pages) ─── */

.anantys-rating-card {
  margin-top: 40px;
  padding: 24px 28px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.anantys-rating-card-question {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2px;
}

.anantys-rating-card-hint {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.anantys-rating-card .anantys-rating {
  padding: 10px 0 0;
  justify-content: center;
}

/* ─── Hero KPI stars (read-only, server-rendered, always dark bg) ─── */

.seo-kpi-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seo-kpi-stars,
.seo-kpi-stars-inline {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.seo-kpi-stars-inline > span {
  margin-left: 4px;
}

.seo-kpi-star {
  width: 14px;
  height: 14px;
  fill: rgba(255, 255, 255, 0.2);
}

.seo-kpi-star.filled {
  fill: hsl(165, 100%, 45%);
}

.seo-kpi-rating-text {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.52);
}

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .anantys-rating {
    gap: 10px;
    padding: 12px 0;
  }

  .anantys-rating-star {
    width: 24px;
    height: 24px;
  }

  .anantys-rating-card {
    margin-top: 24px;
    padding: 16px 20px;
  }

  .anantys-rating-card-question {
    font-size: 15px;
  }

  .seo-kpi-star {
    width: 12px;
    height: 12px;
  }
}
