/* WP Visitas Stats — Frontend Styles */

.wvs-fe-badge { display:inline-flex; align-items:center; gap:6px; font-size:13px; line-height:1; }
.wvs-fe-badge--doble { gap:8px; }

.wvs-fe-pill {
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 12px; border-radius:999px;
  font-size:13px; font-weight:500; line-height:1;
  text-decoration:none !important;
}
.wvs-fe-pill strong { font-weight:700; font-size:14px; }
.wvs-fe-pill--blue  { background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; }
.wvs-fe-pill--green { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0; }
.wvs-fe-lbl { font-size:11px; opacity:.7; font-weight:400; }
.wvs-fe-icon { font-size:13px; line-height:1; }

.wvs-fe-texto { display:inline-flex; align-items:center; gap:4px; font-size:13px; color:#6b7280; }
.wvs-fe-texto strong { color:#111; }

.wvs-fe-numero { font-weight:700; color:#2563eb; }

.wvs-fe-auto {
  margin-top:20px; padding-top:16px; border-top:1px solid #f3f4f6;
  display:flex; align-items:center; gap:8px;
}
.wvs-fe-auto::before {
  content:'Estadísticas:'; font-size:11px; color:#9ca3af;
  font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-right:4px;
}

/* Lista */
.wvs-fe-lista { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.wvs-fe-lista-item { display:flex; flex-direction:column; gap:5px; }
.wvs-fe-lista-top { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.wvs-fe-lista-link { font-size:14px; font-weight:500; color:#111; text-decoration:none; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wvs-fe-lista-link:hover { color:#2563eb; text-decoration:underline; }
.wvs-fe-lista-count { font-size:12px; font-weight:600; color:#6b7280; white-space:nowrap; }
.wvs-fe-bar-track { height:5px; background:#f3f4f6; border-radius:99px; overflow:hidden; }
.wvs-fe-bar-fill  { height:100%; background:linear-gradient(90deg,#2563eb,#7c3aed); border-radius:99px; }

/* Tarjetas */
.wvs-fe-cards { display:flex; flex-direction:column; gap:10px; }
.wvs-fe-card {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background:#fff; border:1px solid #e5e7eb; border-radius:10px;
  text-decoration:none !important; color:inherit;
  transition:box-shadow .15s,border-color .15s;
}
.wvs-fe-card:hover { border-color:#bfdbfe; box-shadow:0 2px 8px rgba(37,99,235,.1); }
.wvs-fe-card-rank {
  width:26px; height:26px; border-radius:50%; background:#eff6ff;
  color:#2563eb; font-size:12px; font-weight:700;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.wvs-fe-card-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.wvs-fe-card-title { font-size:14px; font-weight:600; color:#111; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wvs-fe-card-stats { display:flex; gap:12px; font-size:12px; color:#6b7280; }

.wvs-fe-empty { color:#9ca3af; font-size:13px; font-style:italic; }

/* ── Sparkline ──────────────────────────────────────────────── */
.wvs-sparkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}

.wvs-sp-total {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-weight: 700;
  font-size: 14px;
  color: inherit;
  white-space: nowrap;
}
.wvs-sp-label {
  font-size: 10px;
  font-weight: 400;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wvs-sp-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.wvs-sp-bar-wrap {
  display: inline-flex;
  align-items: flex-end;
  height: 28px;
}

.wvs-sp-bar {
  display: block;
  width: 5px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
  opacity: .35;
  transition: opacity .15s, height .4s ease;
}

/* Last bar (today) is highlighted */
.wvs-sp-bar-wrap:last-child .wvs-sp-bar {
  opacity: 1;
}

.wvs-sp-bar-wrap:hover .wvs-sp-bar {
  opacity: .8;
}

/* Light theme (default) */
.wvs-sparkline {
  color: #2563eb;
}

/* Dark theme — when parent bg is dark */
.wvs-sparkline--dark {
  color: #60a5fa;
}
.wvs-sparkline--dark .wvs-sp-total {
  color: #f9fafb;
}
.wvs-sparkline--light {
  color: #2563eb;
}
.wvs-sparkline--light .wvs-sp-total {
  color: #111827;
}

/* Auto theme: inherit from parent text color */
.wvs-fe-auto .wvs-sparkline {
  color: inherit;
  opacity: .85;
}
.wvs-fe-auto .wvs-sp-total {
  color: inherit;
}

/* Compact in auto-insert row */
.wvs-fe-auto {
  flex-wrap: wrap;
  gap: 10px 16px;
}

/* ── Widgets ────────────────────────────────────────────────── */
.wvs-w-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wvs-w-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.wvs-w-item:last-child { border-bottom: none; }

/* Thumbnail */
.wvs-w-thumb {
  flex-shrink: 0;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}
.wvs-w-thumb img {
  width: 52px !important;
  height: 52px !important;
  object-fit: cover !important;
  margin: 0 !important;
}
.wvs-w-icon-recent {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 15px;
  margin-top: 2px;
}

/* Body */
.wvs-w-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wvs-w-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Rank badge */
.wvs-w-rank {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.wvs-w-rank--1 { background: #fef3c7; color: #d97706; }
.wvs-w-rank--2 { background: #f3f4f6; color: #6b7280; }
.wvs-w-rank--3 { background: #fef3c7; color: #92400e; }

/* Title */
.wvs-w-title {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wvs-w-title:hover { color: #2563eb; text-decoration: underline; }

/* Meta row */
.wvs-w-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wvs-w-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
}
.wvs-w-count--blue  { background: #eff6ff; color: #1d4ed8; }
.wvs-w-count--green { background: #f0fdf4; color: #15803d; }
.wvs-w-time {
  font-size: 11px;
  color: #9ca3af;
}

/* Progress bar */
.wvs-w-bar-track {
  height: 4px;
  background: #f3f4f6;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}
.wvs-w-bar-fill {
  height: 100%;
  background: linear-gradient(90deg,#2563eb,#7c3aed);
  border-radius: 99px;
  transition: width .5s ease;
}

.wvs-w-empty {
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
  margin: 0;
  padding: 8px 0;
}

/* ── Ranking shortcode (wvs_mas_vistas / wvs_mas_unicos) ────── */
.wvs-rank-wrap { font-family: inherit; }
.wvs-rank-titulo {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111827;
}
.wvs-rank-empty {
  color: #9ca3af;
  font-style: italic;
  font-size: 13px;
}

/* List */
.wvs-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

/* 2-column and 3-column grid */
.wvs-rank-grid--2col { columns: 2; column-gap: 24px; }
.wvs-rank-grid--3col { columns: 3; column-gap: 20px; }
@media (max-width: 768px) {
  .wvs-rank-grid--2col,
  .wvs-rank-grid--3col { columns: 1; }
}

/* Item */
.wvs-rank-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f3f4f6;
  break-inside: avoid;
}
.wvs-rank-item:last-child { border-bottom: none; }

/* Medal highlight */
.wvs-rank--medal { background: transparent; }
.wvs-rank--1 .wvs-rank-n { background:#fef3c7; color:#d97706; border-color:#fcd34d; }
.wvs-rank--2 .wvs-rank-n { background:#f3f4f6; color:#6b7280; border-color:#d1d5db; }
.wvs-rank--3 .wvs-rank-n { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.wvs-rank--top10 .wvs-rank-n { color:#4b5563; border-color:#e5e7eb; }

/* Rank number badge */
.wvs-rank-n {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #f3f4f6;
  background: #fff;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  line-height: 1;
}

/* Thumbnail */
.wvs-rank-thumb {
  flex-shrink: 0;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  margin-top: 1px;
}
.wvs-rank-thumb img {
  width: 48px !important;
  height: 48px !important;
  object-fit: cover !important;
  margin: 0 !important;
}

/* Body */
.wvs-rank-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Title */
.wvs-rank-title {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wvs-rank-title:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Meta: count + bar */
.wvs-rank-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wvs-rank-count {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}
.wvs-rank-bar-track {
  flex: 1;
  height: 4px;
  background: #f3f4f6;
  border-radius: 99px;
  overflow: hidden;
  min-width: 40px;
}
.wvs-rank-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: 99px;
}
/* Green gradient for únicos */
.wvs-rank-list--unicos .wvs-rank-bar-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}
