/* ============================================================
   MundiPolla 2026 — Resultados & Admin Resultados Styles
   ============================================================ */

/* ─── Page Layout ─────────────────────────── */
.resultados-page {
  background: var(--bg-dark);
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.page-header {
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.page-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
}

.page-header .logo-icon {
  font-size: 1.5rem;
}

.page-header .logo span {
  background: linear-gradient(135deg, var(--primary-light), var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ─── Auto-refresh banner ─────────────────── */
.auto-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auto-refresh-bar .refresh-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-refresh-bar .refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
}

/* ─── Live Match Hero Card ────────────────── */
.live-match-hero {
  background: linear-gradient(135deg, rgba(0,230,118,0.06) 0%, rgba(0,0,0,0) 100%);
  border: 1px solid rgba(0,230,118,0.2);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.live-match-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
}

.hero-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.hero-match-header .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(0,230,118,0.12);
  border: 1px solid rgba(0,230,118,0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-match-header .live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 1.2s infinite;
}

.hero-match-header .match-group {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 12px;
  background: var(--bg-glass);
  border-radius: 50px;
}

.hero-match-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 8px;
}

.hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-align: center;
}

.hero-team .flag-img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.hero-team .flag-emoji {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.hero-team .team-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-score-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(0,230,118,0.08);
  border: 1px solid rgba(0,230,118,0.2);
  border-radius: var(--radius-lg);
}

.hero-score-display .score-num {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent-green);
  line-height: 1;
  min-width: 60px;
  text-align: center;
}

.hero-score-display .score-colon {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--text-muted);
}

.hero-match-info {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-match-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ─── Bets Table ──────────────────────────── */
.bets-section {
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
}

.bets-section .section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.bets-section .section-title .count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

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

.bets-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.bets-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.9rem;
  vertical-align: middle;
}

.bets-table tbody tr:hover {
  background: var(--bg-glass);
}

.bets-table .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bets-table .user-cell .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.bets-table .prediction-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  background: rgba(212,175,55,0.1);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.bets-table .amount-cell {
  font-weight: 600;
  color: var(--accent-cyan);
}

.bets-table .status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bets-table .status-badge.pendiente {
  background: rgba(68,138,255,0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(68,138,255,0.2);
}

.bets-table .status-badge.acertada {
  background: rgba(0,230,118,0.1);
  color: var(--accent-green);
  border: 1px solid rgba(0,230,118,0.2);
}

.bets-table .status-badge.fallida {
  background: rgba(255,82,82,0.1);
  color: var(--accent-red);
  border: 1px solid rgba(255,82,82,0.2);
}

/* ─── Pool Summary ──────────────────────── */
.pool-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.pool-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.pool-card .pool-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
}

.pool-card .pool-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pool-card .pool-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.pool-card.pool-warning {
  border-color: rgba(255,214,0,0.2);
  background: rgba(255,214,0,0.04);
}

.pool-card.pool-warning .pool-value {
  color: var(--accent-amber);
}

/* ─── Empty State ──────────────────────────── */
.live-empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-glass);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}

.live-empty-state .empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
}

.live-empty-state h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.live-empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── Admin Page Styles ──────────────────── */
.admin-page .admin-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 24px;
}

.admin-page .card {
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

.admin-page .card h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-page .form-group {
  margin-bottom: 20px;
}

.admin-page .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-page .form-group select,
.admin-page .form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

.admin-page .form-group select:focus,
.admin-page .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}

.admin-page .form-group select option {
  background: var(--surface);
  color: var(--text-primary);
}

.admin-page .btn-save {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-page .btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212,175,55,0.35);
}

.admin-page .btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.admin-page .success-msg {
  padding: 12px 16px;
  background: rgba(0,230,118,0.08);
  border: 1px solid rgba(0,230,118,0.2);
  border-radius: var(--radius-md);
  color: var(--accent-green);
  font-size: 0.9rem;
  margin-top: 16px;
  display: none;
}

.admin-page .success-msg.show {
  display: block;
}

/* ─── Login Required ──────────────────────── */
.login-required {
  text-align: center;
  padding: 80px 24px;
}

.login-required .lock-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.login-required h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-required p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Multiple Live Matches ───────────────── */
.multiple-matches .match-section {
  margin-bottom: 40px;
}

.multiple-matches .match-section + .match-section {
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ─── Animations ──────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

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

.fade-in {
  animation: fadeInUp 0.5s ease-out;
}

/* ─── Loading Skeleton ─────────────────────── */
.loading-skeleton {
  padding: 60px;
  text-align: center;
  color: var(--text-muted);
}

.loading-skeleton .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .page-container { padding: 20px 16px 40px; }

  .hero-match-score { flex-direction: column; gap: 16px; }

  .hero-team .flag-img { width: 48px; height: 36px; }

  .hero-team .team-name { font-size: 1rem; }

  .hero-score-display .score-num { font-size: 2rem; min-width: 40px; }

  .hero-score-display .score-colon { font-size: 1.8rem; }

  .hero-match-header { flex-direction: column; gap: 12px; }

  .pool-summary { grid-template-columns: 1fr; }

  .bets-section { padding: 20px 16px; }

  .bets-table { font-size: 0.85rem; }
  .bets-table thead { display: none; }
  .bets-table tbody td {
    display: block;
    padding: 8px 12px;
    border: none;
  }
  .bets-table tbody tr {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }
  .bets-table tbody tr:last-child { border-bottom: none; }

  .admin-page .card { padding: 20px; }
}
