:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-gold: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.nav-logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); text-decoration: none; }

.lang-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1a1e2e 100%);
  border-bottom: 1px solid var(--border);
}

.hero-banner {
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  padding: 0;
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
}

.hero-overlay {
  width: 100%;
  padding: 6rem 2rem 3rem;
  background: linear-gradient(to top, rgba(13,17,23,0.95) 0%, rgba(13,17,23,0.7) 50%, transparent 100%);
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Section */
.section { margin-bottom: 3rem; }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search */
.search-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
  pointer-events: none;
}

.search-count {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Region filter tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.filter-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-tab:hover { border-color: var(--accent); color: var(--text-primary); }

.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-flag { font-size: 2rem; }
.card-title { font-size: 1.1rem; font-weight: 600; }
.card-subtitle { font-size: 0.85rem; color: var(--text-secondary); }

/* Candidate media (logo + photo) */
.candidate-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.candidate-party-logo {
  width: 60px;
  height: auto;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.candidate-photo {
  width: 60px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.candidate-media-emoji {
  width: 60px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 2.2rem;
}

.card-hidden { display: none; }

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }
.stat-source { font-size: 0.7rem; color: var(--text-secondary); opacity: 0.6; margin-top: 0.5rem; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-active { background: rgba(63,185,80,0.15); color: var(--accent-green); }
.badge-soon { background: rgba(210,153,34,0.15); color: var(--accent-gold); }

/* Country Banner */
.country-banner {
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.country-banner-text { color: var(--text-secondary); }
.country-banner-text strong { color: var(--text-primary); }

.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }

/* Chart container */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}

/* Comparison table */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-secondary);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
}

td { font-size: 0.9rem; }

/* Score colors */
.score-high { color: var(--accent-green); font-weight: 700; }
.score-mid { color: var(--accent-gold); font-weight: 700; }
.score-low { color: var(--accent-red); font-weight: 700; }

/* Proposal cards */
.proposal-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.proposal-title { font-weight: 600; margin-bottom: 0.5rem; }
.proposal-text { font-size: 0.9rem; color: var(--text-secondary); }

/* Vision Slider */
.slider-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: 3rem 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.slider-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 0 2rem;
}

.slider-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-green), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.slider-subtitle { color: var(--text-secondary); font-size: 1rem; }

.slider-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.slider-track {
  display: flex;
  gap: 1.5rem;
  overflow: hidden;
  scroll-behavior: smooth;
  padding: 1rem 0.5rem;
  flex: 1;
}

.slider-slide {
  min-width: 320px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  flex-shrink: 0;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.slider-slide:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.1);
}

.slider-slide::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--slide-accent, var(--accent));
}

.slide-year {
  display: inline-block;
  background: var(--slide-accent, var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.slide-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.slide-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.slide-text { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }

.slide-stat {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.slider-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2;
}

.slider-btn:hover { background: var(--bg-secondary); border-color: var(--accent); }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.slider-dot.active { background: var(--accent); transform: scale(1.3); }

/* Interviews Marquee */
.interviews-marquee {
  background: linear-gradient(90deg, var(--bg-secondary), var(--bg-primary), var(--bg-secondary));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 0.5rem 0;
  position: relative;
}

.interviews-marquee::before,
.interviews-marquee::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.interviews-marquee::before { left: 0; background: linear-gradient(to right, var(--bg-secondary), transparent); }
.interviews-marquee::after { right: 0; background: linear-gradient(to left, var(--bg-secondary), transparent); }

.interviews-label {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent-purple);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 0.8rem;
  z-index: 3;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.interviews-track {
  display: flex;
  animation: marquee-slow 60s linear infinite;
  gap: 1rem;
  padding-left: 120px;
  align-items: center;
}

.interviews-track:hover { animation-play-state: paused; }

.interview-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
}

.interview-chip:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
  text-decoration: none;
  transform: translateY(-1px);
}

.interview-chip-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3px currentColor;
}

.interview-chip-thumb::after {
  content: '▶';
  position: absolute;
  font-size: 0.5rem;
  color: #fff;
  background: rgba(255,0,0,0.85);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  bottom: -1px;
  right: -1px;
}

.interview-chip-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.interview-chip-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.interview-chip-party {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.interview-chip-source {
  font-size: 0.6rem;
  color: var(--accent);
}

@keyframes marquee-slow {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Coffee FAB */
.coffee-fab {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  background: #FFDD00;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: width 0.3s ease, border-radius 0.3s;
  overflow: hidden;
  z-index: 50;
}

.coffee-fab:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.4); }

.coffee-fab.expanded {
  width: 210px;
  border-radius: 22px;
}

.coffee-icon {
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.coffee-text {
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s;
  padding-right: 1rem;
}

.coffee-fab.expanded .coffee-text { opacity: 1; }

/* News Ticker */
.news-ticker {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 0.6rem 0;
  position: relative;
}

.news-ticker::before,
.news-ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}

.news-ticker::before { left: 0; background: linear-gradient(to right, var(--bg-secondary), transparent); }
.news-ticker::after { right: 0; background: linear-gradient(to left, var(--bg-secondary), transparent); }

.ticker-label {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 1rem;
  z-index: 3;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticker-track {
  display: flex;
  animation: ticker 45s linear infinite;
  gap: 3rem;
  padding-left: 120px;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.ticker-item a { color: var(--text-primary); text-decoration: none; }
.ticker-item a:hover { color: var(--accent); }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.news-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }

.news-card-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.news-type-debate { background: rgba(248,81,73,0.15); color: var(--accent-red); }
.news-type-foro { background: rgba(63,185,80,0.15); color: var(--accent-green); }
.news-type-analisis { background: rgba(88,166,255,0.15); color: var(--accent); }
.news-type-entrevista { background: rgba(188,140,255,0.15); color: var(--accent-purple); }

.news-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.news-card-desc { font-size: 0.85rem; color: var(--text-secondary); flex: 1; }

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
}

.back-to-top.visible { display: flex; }
.back-to-top:hover { transform: translateY(-2px); }

/* No results */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results-text { font-size: 1.1rem; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 3rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Nav mobile */
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .nav-links.open { display: flex; }

  .nav { padding: 0.75rem 1rem; }

  /* Hero mobile */
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.95rem; }
  .hero-banner { min-height: 300px; }
  .hero-overlay { padding: 3rem 1rem 2rem; }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Cards */
  .card { padding: 1rem; }

  /* Stats */
  .stat-value { font-size: 1.5rem; }

  /* Country banner */
  .country-banner { flex-direction: column; gap: 1rem; text-align: center; }

  /* Container */
  .container { padding: 1rem; }

  /* Slider */
  .slider-slide { min-width: 260px; max-width: 260px; padding: 1.5rem 1rem; }
  .slider-btn { width: 36px; height: 36px; font-size: 1rem; }
  .slider-title { font-size: 1.3rem; }
  .slider-section { padding: 2rem 0; }

  /* Charts */
  .chart-container { padding: 1rem; }

  /* Table */
  th, td { padding: 0.5rem 0.6rem; font-size: 0.8rem; }

  /* Search */
  .search-input { font-size: 0.9rem; }

  /* Back to top */
  .back-to-top { bottom: 1rem; right: 1rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-banner { min-height: 250px; }
  .slider-slide { min-width: 240px; max-width: 240px; }
  .slide-icon { font-size: 2rem; }
  .stat-value { font-size: 1.3rem; }
  .nav-logo { font-size: 1.1rem; }
}
