/* Widget de valoraciones
   (archivo: css/components/ratings.css) */
/* ============================================================
   RATINGS WIDGET
   ============================================================ */
#detail-ratings-wrap {
  flex-shrink: 0;
}
#detail-ratings {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #111;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
}
.rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #1e1e1e;
  transition: background .15s;
}
.rating-row:last-child { border-bottom: none; }
.rating-row:hover { background: #161616; }

.rating-key {
  font-family: 'Fredoka One', cursive;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* signal bars container — pushed all the way right, just before the tag */
.rating-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  flex-shrink: 0;
  margin-left: auto;
}

/* individual bar — slightly wider than before */
.rbar {
  width: 6px;
  border-radius: 1px 1px 0 0;
  background: #222;
  border: 1px solid #2e2e2e;
  overflow: hidden;
  display: block;
  position: relative;
}
.rbar[data-v="1"] { height: 5px;  }
.rbar[data-v="2"] { height: 8px;  }
.rbar[data-v="3"] { height: 11px; }
.rbar[data-v="4"] { height: 15px; }
.rbar[data-v="5"] { height: 19px; }

.rbar-fill {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 1px 1px 0 0;
  opacity: 0;
  transition: opacity .3s ease;
}

/* active state per rating value — color palette matching doc yellow→red */
.rbar.lit .rbar-fill { opacity: 1; }

/* per-value colors: 1=yellow-green, 2=yellow, 3=orange, 4=red-orange, 5=red */
.rbar[data-v="1"].lit .rbar-fill { background: var(--green-done);   box-shadow: 0 0 6px rgba(57,255,20,0.6); }
.rbar[data-v="2"].lit .rbar-fill { background: #a8e63d;             box-shadow: 0 0 5px rgba(168,230,61,0.5); }
.rbar[data-v="3"].lit .rbar-fill { background: var(--yellow-bright); box-shadow: 0 0 6px rgba(255,215,0,0.6); }
.rbar[data-v="4"].lit .rbar-fill { background: var(--text-orange);    box-shadow: 0 0 6px rgba(255,140,0,0.6); }
.rbar[data-v="5"].lit .rbar-fill { background: var(--red-close);      box-shadow: 0 0 6px rgba(255,51,51,0.6); }

/* tag badge — styled like mission counter */
.rating-tag {
  font-family: 'Fredoka One', cursive;
  font-size: 0.75rem;
  letter-spacing: 0.4px;
  color: var(--text-yellow);
  background: #1a1500;
  border: 1.5px solid #3d3000;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  min-width: 76px;
  text-align: center;
  transition: color .25s, background .25s, border-color .25s;
  flex-shrink: 0;
}
/* tag color matches bar level */
.rating-tag.lvl-1 { color: var(--green-done);   background: #081a04; border-color: #1a4a0a; }
.rating-tag.lvl-2 { color: #a8e63d;             background: #0d1a04; border-color: #2a4010; }
.rating-tag.lvl-3 { color: var(--yellow-bright); background: #1a1500; border-color: #3d3000; }
.rating-tag.lvl-4 { color: var(--text-orange);  background: #1a0d00; border-color: #3d2000; }
.rating-tag.lvl-5 { color: var(--red-close);    background: #1a0404; border-color: #3d0a0a; }
.rating-tag.lvl-6 { color: #d8c8ff;             background: #120816; border-color: #261036; }

/* worth uses stars instead of bars */
#rbars-worth {
  gap: 2px;
}
#rbars-worth .rbar {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 15px;
  line-height: 1;
  color: #2a2a2a;
  text-shadow: 0 1px 0 rgba(0,0,0,0.8);
}
#rbars-worth .rbar::before {
  content: '★';
}
#rbars-worth .rbar-fill {
  display: none;
}
#rbars-worth .rbar[data-v="1"] { transform: translateY(0); }
#rbars-worth .rbar[data-v="2"] { transform: translateY(0); }
#rbars-worth .rbar[data-v="3"] { transform: translateY(0); }
#rbars-worth .rbar[data-v="4"] { transform: translateY(0); }
#rbars-worth .rbar[data-v="5"] { transform: translateY(0); }
#rbars-worth .rbar.lit { color: #fff; }
#rbars-worth .rbar[data-v="1"].lit { color: var(--green-done);   text-shadow: 0 0 6px rgba(57,255,20,0.55); }
#rbars-worth .rbar[data-v="2"].lit { color: #a8e63d;             text-shadow: 0 0 5px rgba(168,230,61,0.45); }
#rbars-worth .rbar[data-v="3"].lit { color: var(--yellow-bright); text-shadow: 0 0 6px rgba(255,215,0,0.55); }
#rbars-worth .rbar[data-v="4"].lit { color: var(--text-orange);   text-shadow: 0 0 6px rgba(255,140,0,0.55); }
#rbars-worth .rbar[data-v="5"].lit { color: var(--red-close);     text-shadow: 0 0 6px rgba(255,51,51,0.55); }

.rating-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #101010, #0b0b0b);
  border-top: 1px dashed #2b2b2b;
  border-bottom: 1px dashed #1e1e1e;
}
.rating-divider::before,
.rating-divider::after {
  content: '';
  flex: 1;
  border-top: 1px dashed #333;
  opacity: 0.9;
}
.rating-divider span {
  font-family: 'Fredoka One', cursive;
  font-size: 0.63rem;
  color: #7d7d7d;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* if any rating reaches 6, tint the whole widget dark purple */
#detail-ratings.rating-theme-6 .rating-row { background: #0f0816; }
#detail-ratings.rating-theme-6 .rating-row:hover { background: #170e25; }
#detail-ratings.rating-theme-6 .rating-divider {
  background: linear-gradient(180deg, #140b1f, #0d0714);
  border-top-color: #2f1642;
  border-bottom-color: #220f31;
}
#detail-ratings.rating-theme-6 .rating-divider::before,
#detail-ratings.rating-theme-6 .rating-divider::after {
  border-top-color: #3b2052;
}
#detail-ratings.rating-theme-6 .rating-divider span {
  color: #c2acf9;
}
#detail-ratings.rating-theme-6 .rating-tag {
  color: #d8c8ff;
  background: #120816;
  border-color: #261036;
}
#detail-ratings.rating-theme-6 .rbar {
  color: #463058;
}
#detail-ratings.rating-theme-6 .rbar.lit {
  color: #d8c8ff;
  text-shadow: 0 0 7px rgba(145, 96, 220, 0.85);
}

/* RIGHT COLUMN */
#detail-right {
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
}
#detail-right::-webkit-scrollbar { width: 5px; }
#detail-right::-webkit-scrollbar-thumb { background: var(--yellow-dark); border-radius: 4px; }

#missions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#missions-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.35rem;
  color: var(--yellow-bright);
  text-shadow: 1px 1px 0 #000;
}
#missions-overall-progress {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* overall progress bar in detail */
#missions-overall-bar-wrap {
  flex-shrink: 0;
}
#missions-overall-bar-bg {
  width: 100%;
  height: 10px;
  background: #111;
  border-radius: 6px;
  border: 2px solid #000;
  overflow: hidden;
}
#missions-overall-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow-bright), #ff8c00);
  border-radius: 4px;
  transition: width .5s ease;
}

#missions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* mission row */
.mission-row {
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #1e1e1e;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  transition: border-color .2s, box-shadow .2s;
  animation: missionSlide .3s ease both;
}
.mission-row.done {
  border-color: var(--green-done);
  box-shadow: 0 0 12px rgba(57,255,20,0.22), 0 3px 10px rgba(0,0,0,0.4);
}
.mission-bg {
  padding: 11px 15px;
  background: repeating-linear-gradient(-45deg,#251e00 0,#251e00 16px,#1a1500 16px,#1a1500 32px);
  display: flex;
  align-items: center;
  gap: 11px;
}
.mission-row.done .mission-bg {
  background: repeating-linear-gradient(-45deg,#091709 0,#091709 16px,#040e04 16px,#040e04 32px);
}

/* checkbox */
.mission-check {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 3px solid #555;
  background: #111;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  transition: background .2s, border-color .2s, transform .15s;
  user-select: none;
  color: #000;
  font-weight: bold;
}
.mission-check:hover { transform: scale(1.12); border-color: var(--yellow-bright); }
.mission-row.done .mission-check {
  background: var(--green-done);
  border-color: var(--green-done);
}

/* mission content */
.mission-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.mission-text {
  font-family: 'Fredoka One', cursive;
  font-size: 0.97rem;
  color: var(--text-white);
  text-shadow: 1px 1px 0 #000;
  line-height: 1.2;
}
.mission-row.done .mission-text {
  color: var(--green-done);
  text-decoration: line-through;
  text-decoration-color: rgba(57,255,20,0.35);
}

.mission-bar-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.mission-bar-bg {
  flex: 1;
  height: 8px;
  background: #111;
  border-radius: 5px;
  border: 2px solid #000;
  overflow: hidden;
}
.mission-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow-bright), #ff8c00);
  border-radius: 3px;
  transition: width .4s ease;
}
.mission-row.done .mission-bar-fill {
  background: linear-gradient(90deg, var(--green-done), #00cc55);
}
.mission-counter-label {
  font-size: 0.78rem;
  color: var(--text-yellow);
  font-family: 'Fredoka One', cursive;
  white-space: nowrap;
  min-width: 88px;
  text-align: right;
}
.mission-row.done .mission-counter-label { color: var(--green-done); }

.mission-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.mission-counter-input {
  width: 82px;
  background: #111;
  border: 2px solid #3a3a3a;
  border-radius: 6px;
  color: var(--text-white);
  font-family: 'Fredoka One', cursive;
  font-size: 0.83rem;
  padding: 4px 8px;
  outline: none;
  transition: border-color .2s;
  text-align: center;
}
.mission-counter-input:focus { border-color: var(--yellow-bright); }
.mission-counter-input::-webkit-inner-spin-button,
.mission-counter-input::-webkit-outer-spin-button { opacity: 1; }
.mission-target-label {
  font-family: 'Fredoka One', cursive;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* empty state */
#empty-state {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-family: 'Fredoka One', cursive;
  font-size: 1.35rem;
}

/* ── Save Toast ── */
#save-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111;
  border: 2px solid var(--yellow-bright);
  border-radius: 10px;
  color: var(--yellow-bright);
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  padding: 10px 18px;
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  box-shadow: 0 0 14px rgba(255,215,0,0.3);
}
#save-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reset button ── */
/* ── Page nav selector ── */
#page-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 2px;
}
.page-nav-btn {
  background: #2a2a2a;
  border: 2px solid #383838;
  border-radius: 10px;
  cursor: pointer;
  padding: 6px 14px 6px 10px;
  transition: border-color .18s, background .18s, transform .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.page-nav-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  filter: saturate(0.5) brightness(0.75);
  transition: filter .18s;
}
.page-nav-btn:hover {
  border-color: var(--yellow-mid);
  background: #333;
}
.page-nav-btn:hover img { filter: saturate(1) brightness(1); }
.page-nav-btn.active {
  border-color: var(--yellow-bright);
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(255,215,0,0.25);
}
.page-nav-btn.active img { filter: saturate(1) brightness(1.1); }
.page-nav-btn span {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  color: #666;
  letter-spacing: 0.5px;
  transition: color .18s;
  white-space: nowrap;
}
.page-nav-btn:hover span { color: var(--yellow-mid); }
.page-nav-btn.active span { color: var(--yellow-bright); }

/* ── Slap page placeholder ── */
#slap-view {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 22px;
  padding: 40px 20px;
}
#slap-view img {
  width: min(320px, 70vw);
  opacity: 0.55;
}
/* Los banners de guante NO heredan el opacity 0.55 del placeholder */
#slap-view .glove-card-banner,
#slap-view #glove-detail-banner-img,
#slap-view #glove-detail-glove-img,
#slap-view #glove-detail-badge-img,
#slap-view .btn-glove-mastery-icon,
#slap-view .page-nav-btn img {
  width: auto;
  opacity: 1 !important;
  filter: none !important;
}
#slap-view p {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  color: #555;
  text-align: center;
  max-width: 340px;
  line-height: 1.5;
}

#btn-reset {
  background: transparent;
  border: 2px solid #444;
  border-radius: 8px;
  color: #666;
  font-family: 'Fredoka One', cursive;
  font-size: 0.78rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  margin-top: 4px;
}
#btn-reset:hover {
  border-color: var(--red-close);
  color: var(--red-close);
}

