/* ============================================================
   CREOVEX · Star Rating Widget Styles v2.0
   File: css/rating-widget.css
   ============================================================ */

/* ── Full Widget Card ───────────────────────────────────────── */
.cvx-rating-widget {
  position: relative;
  margin: 40px auto 0;
  max-width: 560px;
  padding: 32px 36px 28px;
  border-radius: 20px;
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.045) 0%,
      rgba(255, 255, 255, 0.018) 50%,
      rgba(251, 191, 36, 0.04) 100%);
  border: 1px solid rgba(251, 191, 36, 0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 2px 60px rgba(251, 191, 36, 0.06);
  text-align: center;
  overflow: hidden;
  animation: cvxWidgetIn 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes cvxWidgetIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cvx-rating-widget::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.12), transparent 70%);
  pointer-events: none;
}
.cvx-rating-widget::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.07), transparent 70%);
  pointer-events: none;
}

/* ── Heading ────────────────────────────────────────────────── */
.cvx-rating-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.55);
  margin-bottom: 4px;
}
.cvx-rating-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.cvx-rating-subtitle {
  font-size: 0.8rem;
  color: rgba(241, 245, 249, 0.4);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ── Stars Row ──────────────────────────────────────────────── */
.cvx-stars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.cvx-star {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  outline: none;
  border-radius: 8px;
  transition: transform 0.18s cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-tap-highlight-color: transparent;
}
.cvx-star:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.6);
  outline-offset: 2px;
}
.cvx-star svg {
  display: block;
  width: 40px;
  height: 40px;
}
.cvx-star svg .star-shape {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1.5;
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}
.cvx-star.hover svg .star-shape {
  fill: rgba(251, 191, 36, 0.35);
  stroke: rgba(251, 191, 36, 0.7);
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}
.cvx-star.hover { transform: scale(1.15); }
.cvx-star.active svg .star-shape {
  fill: #FBBF24;
  stroke: #F59E0B;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.7))
          drop-shadow(0 0 16px rgba(251, 191, 36, 0.35));
}
.cvx-star.pop-anim {
  animation: cvxStarPop 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes cvxStarPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.45) rotate(-8deg); }
  60%  { transform: scale(0.92) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
.cvx-stars-row.rated .cvx-star { cursor: default; }
.cvx-stars-row.rated .cvx-star:not(.active) svg .star-shape {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.08);
}

/* ── Rating Badge ───────────────────────────────────────────── */
.cvx-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-radius: 100px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  transition: all 0.3s ease;
  position: relative;
}
.cvx-rating-badge.loading { opacity: 0.55; }
.cvx-rating-badge.pop {
  animation: cvxBadgePop 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes cvxBadgePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); box-shadow: 0 0 24px rgba(251, 191, 36, 0.4); }
  100% { transform: scale(1); }
}
.cvx-avg {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #FBBF24;
  letter-spacing: -0.3px;
  white-space: nowrap;
  min-width: 60px;
}
.cvx-badge-sep {
  width: 1px; height: 16px;
  background: rgba(251, 191, 36, 0.25);
}
.cvx-votes {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.55);
  white-space: nowrap;
}
.cvx-rating-badge.loading::after {
  content: '';
  position: absolute; right: 14px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, 0.25);
  border-top-color: #FBBF24;
  animation: cvxSpin 0.65s linear infinite;
}
@keyframes cvxSpin { to { transform: rotate(360deg); } }

/* ── Thank You Toast ────────────────────────────────────────── */
.cvx-thanks {
  position: absolute;
  bottom: -60px; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 10px 22px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 0.83rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, bottom 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 10;
}
.cvx-thanks.visible { opacity: 1; bottom: 18px; }

/* ── Responsive (Full Widget) ───────────────────────────────── */
@media (max-width: 600px) {
  .cvx-rating-widget { padding: 24px 22px 22px; margin: 28px auto 0; }
  .cvx-star svg { width: 34px; height: 34px; }
  .cvx-stars-row { gap: 7px; }
}

/* ============================================================
   CARD RATING BADGE — Hub pages
   Small compact pill shown on each tool card
   ============================================================ */

.card-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 7px;
  border-radius: 100px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  font-size: 0.72rem;
  font-weight: 700;
  color: #FBBF24;
  white-space: nowrap;
  position: absolute;
  top: 14px; right: 14px;
  z-index: 5;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(251, 191, 36, 0.12);
}
.card-rating-badge.crb-visible {
  opacity: 1;
  transform: translateY(0);
}
.card-rating-badge.crb-skeleton {
  color: rgba(251, 191, 36, 0.4);
  border-color: rgba(251, 191, 36, 0.08);
  animation: crbPulse 1.2s ease-in-out infinite;
}
@keyframes crbPulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}

.crb-star { font-size: 0.7rem; line-height: 1; }
.crb-avg  { font-size: 0.75rem; font-weight: 800; color: #FBBF24; }
.crb-count {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(251, 191, 36, 0.6);
}

/* ── #1 Rank Badge ──────────────────────────────────────────── */
.cvx-rank-1 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #FBBF24;
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 5;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
  animation: rank1Pulse 2.5s ease-in-out infinite;
}
@keyframes rank1Pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.18); }
  50%       { box-shadow: 0 0 22px rgba(251, 191, 36, 0.4); }
}
