/* ═══════════════════════════════════════
   AlbumTools — Custom Styles
   Stack: Bootstrap 5.3 + custom
════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --primary:     #1a56db;
  --primary-dark:#1340a8;
  --primary-light:#e8effd;
  --accent:      #f59e0b;
  --accent-dark: #d97706;
  --success:     #059669;
  --danger:      #dc2626;
  --purple:      #7c3aed;
  --bg:          #f0f4f8;
  --card-bg:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 4px 24px rgba(0,0,0,.08);
  --shadow-hover:0 8px 32px rgba(0,0,0,.14);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.ls-1   { letter-spacing: .05em; }

/* ── HEADER ── */
.site-header {
  background: var(--primary);
  border-bottom: 4px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(26,86,219,.25);
}

.header-icon {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}

.site-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 2rem;
  color: #fff;
  letter-spacing: .05em;
}

.site-sub {
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  font-weight: 600;
}

.badge-pill {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* ── HERO ── */
.hero-section {
  background: linear-gradient(135deg, #1340a8 0%, #1a56db 50%, #2563eb 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -40px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(245,158,11,.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.8rem;
  letter-spacing: .05em;
  margin-bottom: .5rem;
}
.hero-sub {
  color: rgba(255,255,255,.85);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto 1.5rem;
}

.btn-hero {
  background: var(--accent);
  color: #1e293b;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  padding: .6rem 1.6rem;
  transition: transform .15s, box-shadow .15s;
}
.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245,158,11,.4);
  color: #1e293b;
}
.btn-hero-outline {
  background: transparent;
  color: #fff;
  font-weight: 800;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 999px;
  padding: .6rem 1.6rem;
  transition: background .15s, border-color .15s;
}
.btn-hero-outline:hover {
  background: rgba(255,255,255,.1);
  border-color: #fff;
  color: #fff;
}

/* ── TOOLS NAV ── */
.tools-nav { gap: .5rem; }

.tool-nav-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .55rem 1.2rem;
  border: 2px solid var(--border);
  background: var(--card-bg);
  border-radius: 999px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .18s;
}
.tool-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.tool-nav-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── TOOL SECTIONS ── */
.tool-section {
  display: none;
  animation: fadeSlide .3s ease;
}
.tool-section.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tool-header-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-number {
  font-family: 'Bebas Neue', cursive;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--primary);
  opacity: .18;
  user-select: none;
  min-width: 64px;
}
.tool-name {
  font-family: 'Bebas Neue', cursive;
  font-size: 2rem;
  letter-spacing: .03em;
  color: var(--text);
  margin: 0;
}
.tool-desc {
  color: var(--text-muted);
  font-size: .95rem;
}

/* ── CARDS ── */
.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

/* ── STAT BOXES ── */
.stat-box {
  border-radius: var(--radius-sm);
  padding: 1.1rem .8rem;
  text-align: center;
  border: 2px solid transparent;
}
.stat-value {
  font-family: 'Bebas Neue', cursive;
  font-size: 2.4rem;
  line-height: 1.1;
}
.stat-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .75;
  margin-top: 2px;
}

.stat-green  { background: #d1fae5; color: var(--success);  border-color: #6ee7b7; }
.stat-orange { background: #fef3c7; color: var(--accent-dark); border-color: #fcd34d; }
.stat-blue   { background: var(--primary-light); color: var(--primary); border-color: #93c5fd; }
.stat-purple { background: #ede9fe; color: var(--purple); border-color: #c4b5fd; }

/* ── PROGRESS BAR ── */
.progress-custom {
  background: var(--border);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}
.progress-bar-custom {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.progress-msg {
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* ── BUTTONS ── */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 800;
  transition: background .15s, transform .12s, box-shadow .15s;
}
.btn-primary-custom:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,86,219,.3);
}
.btn-primary-custom:active { transform: translateY(0); }

.btn-share {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  padding: .5rem 1.2rem;
  transition: background .15s, transform .12s;
}
.btn-share:hover { background: #059669; color: #fff; transform: translateY(-1px); }

.btn-retry {
  background: var(--border);
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  padding: .5rem 1.2rem;
  transition: background .15s;
}
.btn-retry:hover { background: #cbd5e1; color: var(--text); }

/* ── SOBRES DETAIL ── */
.sobres-detail {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: .9rem;
  border: 1px solid var(--border);
}
.sobres-detail p { margin-bottom: .35rem; }

/* ── COMPARADOR ── */
.comp-block { }
.comp-block-title {
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: .6rem;
}
.text-primary-custom { color: var(--primary) !important; }

.figuritas-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.fig-tag {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .8rem;
  font-weight: 700;
}
.fig-tag.dar {
  background: #dbeafe;
  color: var(--primary);
}
.fig-tag.recibir {
  background: #d1fae5;
  color: var(--success);
}
.fig-empty {
  color: var(--text-muted);
  font-size: .9rem;
  font-style: italic;
}

.share-link-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
}

.tip-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .88rem;
  color: #92400e;
}

/* ── SIMULADOR ── */
.btn-cantidad {
  flex: 1;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.btn-cantidad.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sobres-container {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-sobres {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

.sobre-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  animation: popIn .25s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.sobre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
  font-weight: 800;
  font-size: .9rem;
  color: var(--text-muted);
}
.sobre-figuritas {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.fig-chip {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  transition: transform .12s;
  cursor: default;
}
.fig-chip:hover { transform: scale(1.1); }

.fig-chip.nueva {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26,86,219,.3);
}
.fig-chip.repetida {
  background: #fef3c7;
  color: var(--accent-dark);
  border: 2px solid #fcd34d;
  position: relative;
}
.fig-chip.repetida::after {
  content: '×';
  position: absolute;
  top: -5px; right: -5px;
  background: var(--accent-dark);
  color: #fff;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: .65rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}

.sim-mini-stat {
  padding: .5rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── FOOTER ── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  font-size: .9rem;
}
.site-footer .fw-600 { color: #fff; }

/* ── FORM ── */
.form-control {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  transition: border-color .15s;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-label { font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-title   { font-size: 2rem; }
  .tool-name    { font-size: 1.6rem; }
  .tool-number  { font-size: 2.5rem; }
  .stat-value   { font-size: 1.9rem; }
  .fig-chip     { width: 40px; height: 40px; font-size: .8rem; }
  .site-title   { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .tool-card, .result-card { padding: 1.25rem 1rem; }
}