/* ========================================
   NEWS SECTION
   ======================================== */
.news-section {
  margin-top: var(--space-lg);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title__icon {
  color: var(--accent-primary);
  font-size: 1.1rem;
}

.section-title span {
  color: var(--accent-primary);
}

.section-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.section-link:hover {
  color: var(--accent-secondary);
  gap: 8px;
}

/* News Cards Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-base);
  cursor: pointer;
  position: relative;
}

.news-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.news-card__img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.news-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.news-card:hover .news-card__img {
  transform: scale(1.08);
}

.news-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.news-card__tag {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.news-card__tag--video {
  background: var(--accent-hot);
  color: white;
}

.news-card__tag--drama {
  background: var(--accent-warning);
  color: var(--bg-primary);
}

.news-card__tag--analysis {
  background: var(--accent-secondary);
  color: var(--bg-primary);
}

.news-card__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  opacity: 0;
  transition: var(--transition-base);
}

.news-card:hover .news-card__play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.news-card__body {
  padding: var(--space-md);
}

.news-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
  display: block;
  max-height: 2.8em;
  
  overflow: hidden;
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.news-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Reacciones en Noticias */
.news-card__reactions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.reaction-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.reaction-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* ========================================
   FULL-WIDTH NEWS (below main grid)
   ======================================== */
.full-width-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-2xl);
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

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

.slide-up {
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* Scan line effect for hero */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 136, 0.01) 2px,
    rgba(0, 255, 136, 0.01) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
  .main {
    grid-template-columns: 1fr 340px;
  }
  .poll-candidates {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .videos-featured {
    grid-template-columns: 1fr 260px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 60px;
  }

  .main {
    grid-template-columns: 1fr;
    padding: var(--space-md);
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(24px);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
  }

  .nav.open {
    display: flex;
  }

  .nav__toggle {
    display: none !important;
  }

  .poll-candidates {
    grid-template-columns: repeat(2, 1fr);
  }

  .poll-title {
    font-size: 1.3rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .videos-featured {
    grid-template-columns: 1fr;
  }

  .videos-compact-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding-bottom: var(--space-sm);
  }

  .video-compact {
    min-width: 260px;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .btn-flash {
    bottom: 85px; /* Evita que el bottom-nav lo tape */
  }
}

@media (max-width: 600px) {
  .poll-candidates {
    grid-template-columns: 1fr;
  }

  .poll-title {
    font-size: 1rem;
  }

  .header__title {
    font-size: 0.85rem;
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }

  .video-compact {
    min-width: 220px;
  }

  .video-compact__thumb {
    width: 100px;
    min-width: 100px;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-accent { color: var(--accent-primary); }
.text-hot { color: var(--accent-hot); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }

/* ========================================
   NOMINATIONS TABLE
   ======================================== */
.nom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.nom-table th, .nom-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.nom-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nom-table td {
  color: var(--text-secondary);
}

.nom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.nom-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.nom-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
}

.nom-reason {
  font-size: 0.75rem;
  font-style: italic;
  max-width: 200px;
}

/* ========================================
   AUTH MODAL
   ======================================== */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow-strong);
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.auth-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-purple), var(--accent-secondary));
}

.auth-modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  z-index: 1;
}

.auth-modal__close:hover {
  color: var(--text-primary);
}

.auth-modal__header {
  padding: var(--space-xl) var(--space-lg) var(--space-md);
  text-align: center;
}

.auth-modal__section {
  padding: 0 var(--space-lg) var(--space-md);
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-muted);
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.auth-btn--email:hover {
  background: #00cc6a;
  transform: translateY(-1px);
}

.auth-btn--register {
  background: var(--bg-tertiary);
  color: var(--accent-secondary);
  border: 1px solid var(--accent-secondary);
}

.auth-btn--register:hover {
  background: var(--accent-secondary-dim);
  transform: translateY(-1px);
}

.auth-btn--anon {
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.25);
  margin-bottom: var(--space-lg);
}

.auth-btn--anon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(168, 85, 247, 0.35);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   QUINIELA RANKING UI
   ======================================== */
.q-tab {
  transition: all 0.2s;
}
.q-tab:hover {
  color: var(--accent-purple);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}
.ranking-list::-webkit-scrollbar {
  width: 6px;
}
.ranking-list::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.ranking-item {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  gap: var(--space-md);
}

.ranking-item.rank-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), var(--bg-secondary));
  border-color: #ffd700;
}
.ranking-item.rank-2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), var(--bg-secondary));
  border-color: #c0c0c0;
}
.ranking-item.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), var(--bg-secondary));
  border-color: #cd7f32;
}

.ranking-pos {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-muted);
  width: 30px;
  text-align: center;
}
.rank-1 .ranking-pos { color: #ffd700; font-size: 1.5rem; }
.rank-2 .ranking-pos { color: #c0c0c0; font-size: 1.4rem; }
.rank-3 .ranking-pos { color: #cd7f32; font-size: 1.3rem; }

.ranking-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-score {
  font-weight: 700;
  color: var(--accent-purple);
  font-size: 1.1rem;
}
.ranking-score span {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-secondary);
}

/* PERFIL DE USUARIO */
.profile-history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.profile-history-item.perfect {
  border-color: var(--accent-primary);
  background: rgba(0,255,136,0.05);
}
#btn-logout-profile:hover {
  background: rgba(255,51,102,0.1) !important;
}

/* =========================================
   PREGUNTA FLASH (RULETA)
   ========================================= */
.btn-flash {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #ffaa00, #ff5500);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: pulseFlash 2s infinite;
}

.btn-flash:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 170, 0, 0.6);
}

.btn-flash__icon {
  font-size: 1.5rem;
}

.btn-flash__text {
  text-align: left;
  font-weight: bold;
  font-size: 0.9rem;
  line-height: 1.1;
}

@keyframes pulseFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 170, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0); }
}

.flash-option {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.flash-option:hover {
  background: rgba(255,255,255,0.1);
}
.flash-option.selected {
  background: rgba(255,170,0,0.2);
  border-color: #ffaa00;
  color: #ffaa00;
  font-weight: bold;
}
/* ========================================
   ESTADISTICAS (Ojo de Datos)
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all 0.3s ease;
}

.stats-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stats-card--crystal {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.1) 0%, var(--bg-card) 100%);
}

.stats-card--danger {
  border-color: rgba(255, 51, 102, 0.5);
  background: linear-gradient(180deg, rgba(255, 51, 102, 0.1) 0%, var(--bg-card) 100%);
}

.stats-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.stats-card__icon {
  font-size: 1.5rem;
}

.stats-card__title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes pulseGlow {
  0% { text-shadow: 0 0 5px var(--accent-purple); }
  50% { text-shadow: 0 0 20px var(--accent-purple), 0 0 30px var(--accent-purple); }
  100% { text-shadow: 0 0 5px var(--accent-purple); }
}

/* ==========================================================================
   FLOATING KO-FI BUTTON
   ========================================================================== */
.floating-kofi {
  position: fixed;
  bottom: 80px; /* Above mobile nav */
  left: 20px;
  background: linear-gradient(135deg, #13C3FF, #FF5E5B);
  color: white;
  border-radius: 30px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(255, 94, 91, 0.4);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.floating-kofi:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 94, 91, 0.6);
}

.floating-kofi__icon {
  font-size: 1.5rem;
}

.floating-kofi__text {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .floating-kofi {
    bottom: 30px;
  }
}
