/* ===================================================
   RADAR DE INVERSIÓN — Design System 2026
   Mobile-first · Dark fintech · Premium
   =================================================== */

/* === CSS VARIABLES === */
:root {
  /* Backgrounds */
  --bg-deep:        #070B14;
  --bg-base:        #0C1220;
  --bg-surface:     #111827;
  --bg-card:        #141D2E;
  --bg-card-hover:  #19243A;
  --bg-header:      rgba(7, 11, 20, 0.88);

  /* Signals */
  --buy:            #00E5A0;
  --hold:           #F5A623;
  --sell:           #FF4D6D;
  --buy-bg:         rgba(0, 229, 160, 0.10);
  --hold-bg:        rgba(245, 166, 35, 0.10);
  --sell-bg:        rgba(255, 77, 109, 0.10);
  --buy-border:     rgba(0, 229, 160, 0.32);
  --hold-border:    rgba(245, 166, 35, 0.32);
  --sell-border:    rgba(255, 77, 109, 0.32);

  /* Accent */
  --accent:         #3B82F6;
  --accent-soft:    rgba(59, 130, 246, 0.14);
  --accent-border:  rgba(59, 130, 246, 0.38);

  /* Text */
  --text-1:         #F0F4FF;
  --text-2:         #7B91B0;
  --text-3:         #3D5070;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.06);
  --border-card:    rgba(255, 255, 255, 0.07);

  /* Layout */
  --pad:            16px;
  --card-r:         20px;
  --header-h:       60px;
  --nav-h:          68px;
}

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(30, 58, 138, 0.25) 0%, transparent 70%),
    linear-gradient(165deg, #0A1628 0%, #070B14 55%, #0D1432 100%);
  background-attachment: fixed;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* === HEADER === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--pad);
  max-width: 480px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.4));
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

.header-live {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  background: rgba(0, 229, 160, 0.07);
  border: 1px solid rgba(0, 229, 160, 0.18);
  border-radius: 100px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--buy);
  box-shadow: 0 0 8px rgba(0, 229, 160, 0.7);
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

.live-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--buy);
  letter-spacing: 0.3px;
}

.header-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all 0.18s;
}

.header-action:active {
  background: var(--bg-card);
  transform: scale(0.92);
}

/* === MAIN LAYOUT === */
.main {
  padding-top: calc(var(--header-h) + 20px);
  padding-bottom: calc(var(--nav-h) + 8px);
  max-width: 480px;
  margin: 0 auto;
}

/* === SEARCH === */
.search-section {
  padding: 0 var(--pad) 14px;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 100px;
  padding: 13px 18px;
  color: var(--text-3);
  font-size: 14px;
  cursor: text;
  transition: border-color 0.2s;
}

.search-pill:hover,
.search-pill:focus-within {
  border-color: var(--accent-border);
}

/* === FILTER CHIPS === */
.filter-section {
  padding-bottom: 18px;
}

.filter-scroll {
  display: flex;
  gap: 8px;
  padding: 0 var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chip.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.chip:active {
  transform: scale(0.93);
}

/* === CARDS FEED === */
.cards-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 var(--pad);
}

/* === ASSET CARD === */
.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--card-r);
  padding: 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: card-in 0.4s ease both;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

/* Top shimmer line */
.asset-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.09) 50%,
    transparent 100%);
}

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

.asset-card:active {
  transform: scale(0.975);
  background: var(--bg-card-hover);
}

.asset-card.hidden {
  display: none;
}

/* --- Card Row 1: Identity + Price --- */
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.card-names {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.asset-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}

.asset-ticker {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.card-price-block {
  text-align: right;
}

.asset-price {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.8px;
  transition: color 0.8s ease;
}

.asset-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}

.positive { color: var(--buy); }
.negative { color: var(--sell); }

/* --- Card Row 2: Sparkline --- */
.card-chart {
  margin-bottom: 18px;
  height: 50px;
}

.sparkline {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Card Row 3: Signal + Precision --- */
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Signal badge */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid;
  flex-shrink: 0;
  transition: box-shadow 0.3s;
}

.signal-badge.buy  { background: var(--buy-bg);  border-color: var(--buy-border);  color: var(--buy);  box-shadow: 0 0 18px rgba(0,229,160,0.12); }
.signal-badge.hold { background: var(--hold-bg); border-color: var(--hold-border); color: var(--hold); box-shadow: 0 0 18px rgba(245,166,35,0.12); }
.signal-badge.sell { background: var(--sell-bg); border-color: var(--sell-border); color: var(--sell); box-shadow: 0 0 18px rgba(255,77,109,0.12); }

.signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: sig-pulse 2.8s ease-in-out infinite;
}

@keyframes sig-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.65); }
}

.signal-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

/* Precision block */
.precision-block {
  flex: 1;
  min-width: 0;
}

.precision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.precision-label {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.precision-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}

.precision-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: hidden;
}

.precision-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === AFFILIATE CTA === */
.affiliate-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,229,160,0.10) 0%, rgba(0,229,160,0.04) 100%);
  border: 1px solid rgba(0,229,160,0.22);
  text-decoration: none;
  color: var(--buy);
  transition: all 0.2s ease;
  cursor: pointer;
}

.affiliate-cta:hover {
  background: linear-gradient(135deg, rgba(0,229,160,0.16) 0%, rgba(0,229,160,0.08) 100%);
  border-color: rgba(0,229,160,0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,229,160,0.12);
}

.affiliate-cta:active {
  transform: scale(0.97);
}

.affiliate-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(0,229,160,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.affiliate-text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.affiliate-arrow {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.7;
  transition: transform 0.2s, opacity 0.2s;
}

.affiliate-cta:hover .affiliate-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* Versión neutra para SELL / HOLD */
.affiliate-neutral {
  background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(59,130,246,0.03) 100%);
  border-color: rgba(59,130,246,0.18);
  color: var(--accent);
}

.affiliate-neutral:hover {
  background: linear-gradient(135deg, rgba(59,130,246,0.14) 0%, rgba(59,130,246,0.06) 100%);
  border-color: rgba(59,130,246,0.30);
  box-shadow: 0 4px 20px rgba(59,130,246,0.10);
}

.affiliate-neutral .affiliate-icon {
  background: rgba(59,130,246,0.12);
}

/* === AD SLOT === */
.ad-slot {
  background: #090D18;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 10px 16px 12px;
  position: relative;
}

.ad-label {
  font-size: 9px;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.ad-content {
  height: 60px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 11px;
  border: 1px dashed rgba(255,255,255,0.05);
  letter-spacing: 0.3px;
}

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 200;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  color: var(--text-3);
  border-radius: 14px;
  min-width: 64px;
  transition: all 0.2s;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-btn span {
  font-size: 10px;
  font-weight: 500;
}

.nav-btn:active {
  transform: scale(0.88);
}

/* === PRICE FLASH === */
@keyframes flash-up {
  0%  { color: #fff; }
  25% { color: var(--buy); }
  100%{ color: #fff; }
}

@keyframes flash-down {
  0%  { color: #fff; }
  25% { color: var(--sell); }
  100%{ color: #fff; }
}

.flash-up   { animation: flash-up   1.1s ease; }
.flash-down { animation: flash-down 1.1s ease; }

/* === DIVIDER === */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.07) 50%,
    transparent 100%);
  margin: 0 var(--pad);
}

/* === SPONSOR BANNER === */
.sponsor-banner {
  margin: 20px var(--pad) 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(59,130,246,0.03) 100%);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  grid-column: 1 / -1;
}

.sponsor-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.sponsor-logos {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sponsor-link {
  text-decoration: none;
  transition: all 0.2s;
}

.sponsor-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.2px;
  transition: color 0.2s;
}

.sponsor-link:hover .sponsor-name {
  color: #60A5FA;
}

.sponsor-sep {
  color: var(--text-3);
  font-size: 10px;
}

/* === DISCLAIMER FOOTER === */
.disclaimer {
  margin: 24px var(--pad) 0;
  padding: 20px 0 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  grid-column: 1 / -1;
}

.disclaimer-text {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto 12px;
}

.disclaimer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.disclaimer-links a {
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}

.disclaimer-links a:hover { color: var(--accent); }

.disclaimer-links span {
  color: var(--text-3);
  font-size: 10px;
}

.disclaimer-copy {
  font-size: 10px;
  color: var(--text-3);
}

/* === BACK BUTTON (páginas internas) === */
.back-btn {
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.2s;
}

.back-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

/* === PÁGINAS INTERNAS (Privacidad / Acerca) === */
.page-main {
  padding-top: calc(var(--header-h) + 20px);
  padding-bottom: 48px;
  max-width: 480px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* Cabecera azulada de página */
.page-hero {
  background: linear-gradient(135deg, rgba(30,58,138,0.35) 0%, rgba(59,130,246,0.12) 100%);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 20px;
  padding: 24px 22px 20px;
  margin-bottom: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.page-date {
  font-size: 11px;
  color: var(--text-3);
  margin: 0;
}

.page-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 24px 22px;
}

.page-section {
  margin-bottom: 24px;
}

.page-section h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(59,130,246,0.15);
}

.page-section p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 10px;
  text-align: justify;
}

.page-section ul {
  padding-left: 16px;
  margin-bottom: 10px;
}

.page-section li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 5px;
  text-align: justify;
}

.page-section a {
  color: var(--accent);
  text-decoration: none;
}

.page-section a:hover { text-decoration: underline; }

/* About cards */
.about-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.about-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}

.about-card p {
  margin-bottom: 0 !important;
}

/* Signal demo rows */
.signal-demo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.signal-demo-row p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 0 !important;
  line-height: 1.5;
}

/* Responsive page */
@media (min-width: 640px) {
  .page-main { max-width: 640px; }
}

@media (min-width: 1024px) {
  .page-main { max-width: 720px; }
  .page-content { padding: 40px; }
}

/* =====================================================
   RESPONSIVE — TABLET (640px+)
   ===================================================== */
@media (min-width: 640px) {
  :root {
    --pad: 24px;
  }

  .header-inner,
  .main {
    max-width: 720px;
  }

  .cards-feed {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .ad-slot {
    grid-column: 1 / -1;
  }
}

/* =====================================================
   RESPONSIVE — DESKTOP (1024px+)
   ===================================================== */
@media (min-width: 1024px) {
  :root {
    --pad: 32px;
  }

  body {
    background-attachment: fixed;
  }

  .header-inner {
    max-width: 1200px;
  }

  .main {
    max-width: 1200px;
    padding-top: calc(var(--header-h) + 32px);
    padding-bottom: 40px;
    padding-left: var(--pad);
    padding-right: var(--pad);
    display: grid;
    grid-template-columns: 1fr 308px;
    grid-template-rows: auto auto 1fr;
    column-gap: 28px;
    align-items: start;
  }

  .search-section  { grid-column: 1; padding: 0 0 16px; }
  .filter-section  { grid-column: 1; }

  .cards-feed {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    align-content: start;
  }

  /* Desktop sidebar */
  .sidebar {
    grid-column: 2;
    grid-row: 1 / 4;
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .bottom-nav { display: none; }

  /* Desktop hover on cards */
  .asset-card:hover {
    transform: translateY(-3px);
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.11);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
  }

  .asset-card:active {
    transform: translateY(-1px);
  }
}
