/* ============================================================
   CryptoCompara — Public Design System v2
   Bootstrap 5 base + custom layer
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --gold:          #f0b90b;
  --gold-light:    #ffd740;
  --gold-dark:     #c89500;
  --gold-glow:     rgba(240,185,11,.18);
  --dark:          #0d1117;
  --dark-2:        #161b22;
  --dark-3:        #21262d;
  --dark-4:        #30363d;
  --text-muted:    #8b949e;
  --success:       #3fb950;
  --danger:        #f85149;
  --blue:          #0969da;
  --radius:        .75rem;
  --radius-lg:     1.25rem;
  --radius-xl:     1.75rem;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.07);
  --shadow:        0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:     0 8px 40px rgba(0,0,0,.14);
  --transition:    .18s ease;
  --border:        #e1e4e8;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f6f8fa;
  color: #111;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Text on light backgrounds */
.text-muted { color: #555 !important; }
.text-dark   { color: #111 !important; }

a { transition: color var(--transition); }
img { max-width: 100%; }

/* ── Affiliate notice bar ─────────────────────────────────── */
.affiliate-bar {
  background: var(--dark-2);
  color: #adbac7;
  font-size: .76rem;
  letter-spacing: .01em;
  border-bottom: 1px solid var(--dark-4);
  padding: 6px 0;
}
.affiliate-bar a { color: var(--gold); text-decoration: none; }
.affiliate-bar a:hover { color: var(--gold-light); }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background: rgba(13,17,23,.97) !important;
  border-bottom: 1px solid var(--dark-4);
  padding: .55rem 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.navbar-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: #fff !important;
  gap: .4rem;
}
.navbar-brand i { color: var(--gold); }
.navbar .nav-link {
  color: #cdd9e5 !important;
  font-size: .875rem;
  font-weight: 500;
  padding: .38rem .7rem !important;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  background: rgba(255,255,255,.08);
  color: #fff !important;
}
.navbar .dropdown-menu {
  background: var(--dark-2);
  border: 1px solid var(--dark-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  min-width: 230px;
  margin-top: 6px !important;
}
.navbar .dropdown-item {
  color: #cdd9e5;
  border-radius: 6px;
  font-size: .85rem;
  padding: .42rem .75rem;
  transition: background var(--transition);
}
.navbar .dropdown-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.navbar .dropdown-divider { border-color: var(--dark-4); margin: .3rem .5rem; }
.navbar-toggler { border-color: rgba(255,255,255,.2); padding: .25rem .5rem; }
.navbar-toggler-icon { filter: invert(1); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero-section {
  background: var(--dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-section h1,
.hero-section h2,
.hero-section p,
.hero-section li { color: #fff; }
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 70% at 75% 60%, rgba(240,185,11,.09) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 10% 20%, rgba(59,130,246,.07) 0%, transparent 60%),
    linear-gradient(160deg, #0d1117 0%, #161b22 60%, #0d1117 100%);
  pointer-events: none;
}
.hero-section > * { position: relative; }
.hero-section h1 {
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.hero-section .lead { color: #c9d1d9; font-size: 1.08rem; }
.hero-section .text-warning { color: var(--gold) !important; }

/* ── Quick filter bar ─────────────────────────────────────── */
.quick-filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.quick-filter-bar .btn-outline-secondary {
  border-color: #d0d7de;
  color: #57606a;
  font-size: .78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: .28rem .85rem;
  transition: all var(--transition);
}
.quick-filter-bar .btn-outline-secondary:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--gold-glow);
}

/* ── Section titles ───────────────────────────────────────── */
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: #0d1117;
}

.section-title-line {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.section-title-line::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: var(--gold);
  border-radius: 999px;
  flex-shrink: 0;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  background: #fff;
}
.card-hover {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg) !important;
  border-color: #d0d7de !important;
}
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  border-bottom: 1px solid var(--border) !important;
  background: #f6f8fa !important;
  font-size: .875rem;
  font-weight: 600;
}
.card-header.bg-dark {
  background: var(--dark) !important;
  border-bottom-color: var(--dark-4) !important;
  color: #cdd9e5 !important;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Score badges ─────────────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #000;
  font-weight: 800;
  font-size: .88rem;
  box-shadow: 0 2px 10px rgba(240,185,11,.3);
  flex-shrink: 0;
}
.score-badge-sm {
  display: inline-block;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #000;
  font-weight: 700;
  font-size: .78rem;
}

/* ── Exchange table ───────────────────────────────────────── */
.exchange-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.exchange-table thead th {
  background: var(--dark) !important;
  color: #d0d7de;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .9rem 1rem;
  border: none !important;
  white-space: nowrap;
}
.exchange-table thead th:first-child { border-radius: var(--radius) 0 0 0; }
.exchange-table thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
.exchange-table tbody tr {
  border-bottom: 1px solid #f0f2f4;
  transition: background var(--transition);
}
.exchange-table tbody tr:last-child { border-bottom: none; }
.exchange-table tbody tr:hover { background: rgba(240,185,11,.035); }
.exchange-table tbody td { padding: .9rem 1rem; vertical-align: middle; }

/* ── Comparison table ─────────────────────────────────────── */
.table thead.table-dark th {
  background: var(--dark) !important;
  color: #d0d7de;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: none !important;
}
.table-striped tbody tr:nth-of-type(odd) { background: #fafbfc; }
.table tbody td, .table tbody th { padding: .75rem 1rem; vertical-align: middle; font-size: .9rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  font-weight: 600;
  font-size: .875rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: -.01em;
}
.btn-warning {
  background: linear-gradient(135deg, #e6a800 0%, var(--gold) 50%, var(--gold-light) 100%);
  border: none;
  color: #000;
  box-shadow: 0 2px 8px rgba(240,185,11,.28);
}
.btn-warning:hover {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: 0 4px 18px rgba(240,185,11,.42);
  transform: translateY(-1px);
  color: #000;
}
.btn-warning:active { transform: translateY(0); }
.btn-dark {
  background: var(--dark);
  border-color: var(--dark-4);
  color: #e6edf3;
}
.btn-dark:hover { background: var(--dark-2); color: #fff; }
.btn-outline-dark {
  border-color: #d0d7de;
  color: #1f2328;
  background: transparent;
}
.btn-outline-dark:hover { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-outline-light { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.85); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); color: #fff; }
.btn-lg { padding: .65rem 1.6rem; font-size: .975rem; }
.btn-sm { padding: .28rem .7rem; font-size: .8rem; border-radius: 6px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .03em;
  padding: .28em .6em;
  border-radius: 6px;
}
.bg-primary-subtle   { background: #dbeafe !important; }
.bg-warning-subtle   { background: #fef9c3 !important; }
.bg-success-subtle   { background: #dcfce7 !important; }
.bg-danger-subtle    { background: #fee2e2 !important; }
.bg-info-subtle      { background: #e0f2fe !important; }
.bg-secondary-subtle { background: #f1f5f9 !important; }

/* ── Hero SVG ─────────────────────────────────────────────── */
.hero-img-wrap img { filter: drop-shadow(0 8px 32px rgba(240,185,11,.18)); }

/* ── Progress bars ────────────────────────────────────────── */
.progress { background: #e9ecef; border-radius: 999px; overflow: hidden; height: 8px; }
.progress-bar { border-radius: 999px; transition: width .7s cubic-bezier(.4,0,.2,1); }

/* ── Accordion (FAQ) ──────────────────────────────────────── */
.accordion-button {
  font-weight: 600;
  font-size: .93rem;
  color: #1f2328;
  background: #fff;
}
.accordion-button:not(.collapsed) {
  color: var(--dark);
  background: #fffbeb;
  box-shadow: none;
}
.accordion-button:focus { box-shadow: 0 0 0 3px var(--gold-glow); }
.accordion-button::after { filter: brightness(.3); }
.accordion-item {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  margin-bottom: .5rem;
  overflow: hidden;
}
.accordion-body { font-size: .93rem; color: #3d4450; line-height: 1.7; }

/* Card text */
.card .card-body p,
.card .small,
.card small { color: #111; }
.card .text-muted { color: #555 !important; }

/* ── Winner banner ────────────────────────────────────────── */
.winner-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  border: none !important;
}
.winner-banner .bi-trophy-fill { font-size: 1.8rem; color: var(--gold); }

/* ── Comparison: exchange cards ───────────────────────────── */
.exchange-compare-card {
  border: 2px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.exchange-compare-card:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 4px var(--gold-glow) !important;
}

/* ── Promo box ────────────────────────────────────────────── */
.promo-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid var(--gold) !important;
  border-radius: var(--radius-lg) !important;
}

/* ── Sticky sidebar ───────────────────────────────────────── */
@media (min-width: 992px) {
  .sidebar-sticky { position: sticky; top: 76px; }
}

/* ── News ─────────────────────────────────────────────────── */
.news-card .card-img-top {
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.article-body {
  line-height: 1.85;
  font-size: 1.05rem;
  color: #1f2328;
}
.article-body p     { margin-bottom: 1.3rem; }
.article-body h2,
.article-body h3    { margin: 2rem 0 .75rem; font-weight: 700; }
.article-body a     { color: var(--blue); text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 1rem;
  margin-left: 0;
  color: #57606a;
  font-style: italic;
}
.lead-quote {
  border-left: 4px solid var(--gold);
  padding-left: 1.25rem;
  font-size: 1.08rem;
  color: #57606a;
  font-style: italic;
}

/* ── Category badges ──────────────────────────────────────── */
.cat-bitcoin    { background: #fef3c7; color: #92400e; }
.cat-altcoins   { background: #ede9fe; color: #5b21b6; }
.cat-regulacion { background: #fee2e2; color: #991b1b; }
.cat-empresas   { background: #dbeafe; color: #1e40af; }
.cat-mercado    { background: #dcfce7; color: #166534; }
.cat-general    { background: #f1f5f9; color: #374151; }

/* ── Filter page ──────────────────────────────────────────── */
.filter-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  color: #57606a;
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.filter-chip:hover,
.filter-chip.active {
  border-color: var(--gold);
  background: #fffbeb;
  color: #92400e;
}
.filter-chip input[type="checkbox"] { display: none; }

/* ── Ranking table ────────────────────────────────────────── */
.rank-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: .82rem;
  flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #f0b90b, #ffd740); color: #000; box-shadow: 0 2px 8px rgba(240,185,11,.35); }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #e5e7eb); color: #374151; }
.rank-3 { background: linear-gradient(135deg, #f97316, #fb923c); color: #fff; }
.rank-n { background: #f1f5f9; color: #6b7280; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { gap: .2rem; }
.page-link {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border);
  color: #1f2328;
  font-weight: 500;
  font-size: .85rem;
  padding: .38rem .7rem;
  transition: all var(--transition);
}
.page-link:hover { background: var(--gold); border-color: var(--gold); color: #000; }
.page-item.active .page-link {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(240,185,11,.3);
}

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius) !important;
  border: none;
  font-size: .9rem;
}
.alert-warning  { background: #fffbeb; color: #92400e; border-left: 4px solid var(--gold) !important; }
.alert-success  { background: #f0fdf4; color: #166534; border-left: 4px solid var(--success) !important; }
.alert-danger   { background: #fff5f5; color: #991b1b; border-left: 4px solid var(--danger) !important; }
.alert-info     { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6 !important; }
.alert-secondary{ background: #f8f9fa; color: #57606a; border-left: 4px solid #9ca3af !important; }

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid #d0d7de;
  border-radius: var(--radius);
  font-size: .9rem;
  padding: .5rem .85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  outline: none;
}
.form-label { font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: .3rem; letter-spacing: .01em; }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--gold-glow); }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--dark) !important;
  border-top: 1px solid var(--dark-4);
}
footer h5 { color: var(--gold); font-weight: 800; font-size: 1.05rem; }
footer h6 { color: #adbac7; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
footer a { color: #adbac7 !important; text-decoration: none; font-size: .85rem; line-height: 2; }
footer a:hover { color: var(--gold) !important; }
footer p  { font-size: .85rem; color: #adbac7; }
footer hr { border-color: var(--dark-4) !important; opacity: 1; }
footer .text-muted { color: #8b949e !important; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { background: none; padding: 0; font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { color: #9ca3af; }
.breadcrumb-item a { color: var(--blue); text-decoration: none; }
.breadcrumb-item.active { color: #57606a; }

/* ── List group ───────────────────────────────────────────── */
.list-group-item { border-color: var(--border); font-size: .88rem; }
.list-group-item.active { background: var(--gold); border-color: var(--gold); color: #000; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #c9d1d9; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .4s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* ── Utilities ────────────────────────────────────────────── */
.text-gold   { color: var(--gold) !important; }
.bg-gold     { background: var(--gold) !important; color: #000; }
.border-gold { border-color: var(--gold) !important; }
.fw-800   { font-weight: 800 !important; }
.fs-sm    { font-size: .85rem !important; }
.rounded-xl { border-radius: var(--radius-lg) !important; }
.rounded-2xl { border-radius: var(--radius-xl) !important; }
.bg-stripe  { background: repeating-linear-gradient(45deg,transparent,transparent 8px,rgba(0,0,0,.02) 8px,rgba(0,0,0,.02) 16px); }

/* ── Dark section ─────────────────────────────────────────── */
section.bg-dark .card { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.08) !important; }
section.bg-dark .card:hover { background: rgba(255,255,255,.09) !important; }
section.bg-dark,
section.bg-dark h1, section.bg-dark h2, section.bg-dark h3,
section.bg-dark h4, section.bg-dark h5, section.bg-dark h6,
section.bg-dark p, section.bg-dark li, section.bg-dark span,
section.bg-dark td, section.bg-dark th { color: #fff; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
  .navbar .dropdown-menu { margin-top: 2px !important; }
}

@media (max-width: 768px) {
  .hero-section h1  { font-size: 1.8rem; }
  .hero-section .lead { font-size: .97rem; }
  .exchange-table thead { display: none; }
  .exchange-table tbody td { display: block; border: none; padding: .3rem 1rem; }
  .exchange-table tbody td:first-child { padding-top: .75rem; }
  .exchange-table tbody td:last-child { padding-bottom: .75rem; }
  .exchange-table tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .6rem;
    display: block;
    background: #fff;
  }
}

@media (max-width: 576px) {
  .score-badge { width: 38px; height: 38px; font-size: .8rem; }
  .btn-lg { font-size: .9rem; padding: .58rem 1.2rem; }
  .card-body { padding: 1rem; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .navbar, .affiliate-bar, footer, .btn, .sidebar { display: none !important; }
  body { background: #fff; }
}
