/* 
  FIFA World Cup 2026 Theme Stylesheet
  Design Concept: High-Contrast Dark Theme, Neon Accents (Teal, Green, Pink, Gold), Glassmorphism, & Modern Typography
*/

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

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d111a;
  --bg-card: rgba(18, 24, 38, 0.65);
  --bg-card-hover: rgba(26, 34, 54, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 229, 255, 0.15);
  
  --accent-green: #00ff87;
  --accent-teal: #00e5ff;
  --accent-gold: #ffd700;
  --accent-pink: #ff2a85;
  --accent-red: #ff3860;
  --accent-blue: #2d62ff;
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-family: 'Outfit', 'Inter', sans-serif;
  
  --shadow-glow-green: 0 0 15px rgba(0, 255, 135, 0.3);
  --shadow-glow-teal: 0 0 15px rgba(0, 229, 255, 0.3);
  --shadow-glow-gold: 0 0 15px rgba(255, 215, 0, 0.3);
  --shadow-glow-pink: 0 0 15px rgba(255, 42, 133, 0.3);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 229, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 42, 133, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(0, 255, 135, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* Header & Brand */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-teal));
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-glow-pink);
  display: inline-block;
}

h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 10px;
  text-transform: uppercase;
  background: linear-gradient(to right, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 24px;
}

/* Real-time Clock and Simulation */
.time-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  width: 100%;
}

.current-time-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock-icon {
  color: var(--accent-teal);
  animation: pulse-glow-teal 2s infinite;
}

.time-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.time-val {
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-left: 5px;
}

.simulation-control {
  display: flex;
  align-items: center;
  gap: 15px;
  border-left: 1px solid var(--border-color);
  padding-left: 20px;
}

.sim-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.sim-toggle input {
  display: none;
}

.toggle-switch {
  width: 40px;
  height: 20px;
  background-color: var(--text-muted);
  border-radius: 20px;
  position: relative;
  transition: var(--transition-smooth);
}

.toggle-switch::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: white;
  top: 3px;
  left: 3px;
  transition: var(--transition-smooth);
}

.sim-toggle input:checked + .toggle-switch {
  background-color: var(--accent-pink);
  box-shadow: var(--shadow-glow-pink);
}

.sim-toggle input:checked + .toggle-switch::before {
  left: 23px;
}

.sim-input-group {
  display: none;
  align-items: center;
  gap: 8px;
}

.sim-input-group.active {
  display: flex;
}

.sim-datetime-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.9rem;
  outline: none;
}

.sim-datetime-input:focus {
  border-color: var(--accent-pink);
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

/* Main Grid Layout */
.app-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
}

@media (max-width: 1024px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Base */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Match Detail Card */
.match-hero {
  margin-bottom: 24px;
  border: 1px solid rgba(0, 229, 255, 0.15);
  position: relative;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.05), transparent 60%), var(--bg-card);
}

.match-hero::before {
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-blue));
}

.match-status-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.match-status-badge.open {
  background: rgba(0, 255, 135, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 135, 0.3);
  box-shadow: var(--shadow-glow-green);
}

.match-status-badge.locked {
  background: rgba(255, 42, 133, 0.15);
  color: var(--accent-pink);
  border: 1px solid rgba(255, 42, 133, 0.3);
  box-shadow: var(--shadow-glow-pink);
}

.match-status-badge.finished {
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: var(--shadow-glow-gold);
}

.match-info-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin: 20px 0;
}

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

.flag-wrapper {
  width: 90px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3), 0 0 1px rgba(255,255,255,0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.match-vs {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-muted);
  font-style: italic;
  position: relative;
}

.match-vs::after {
  content: 'VS';
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-muted);
}

.actual-score-display {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 2.5rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: var(--accent-gold);
  text-shadow: var(--shadow-glow-gold);
  background: rgba(0,0,0,0.3);
  padding: 8px 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.match-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.countdown-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.countdown-timer {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--accent-teal);
  letter-spacing: 2px;
}

.countdown-timer.expired {
  color: var(--accent-pink);
}

/* Predictions Section */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title svg {
  color: var(--accent-teal);
}

.predictions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prediction-row {
  display: grid;
  grid-template-columns: 140px 1.5fr 1fr;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.prediction-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.participant-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
}

.participant-name {
  font-weight: 600;
  font-size: 1rem;
}

.score-inputs-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.score-input {
  width: 50px;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: white;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: var(--transition-smooth);
}

.score-input:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.score-input:disabled {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  border-color: transparent;
  cursor: not-allowed;
}

.score-colon {
  font-weight: 700;
  color: var(--text-muted);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.save-btn {
  background: linear-gradient(135deg, var(--accent-green), #00d166);
  border: none;
  color: #07090e;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
}

.save-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.save-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-green);
}

.status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}

.status-badge.saved {
  background: rgba(0, 255, 135, 0.1);
  color: var(--accent-green);
}

.status-badge.unsaved {
  background: rgba(255, 42, 133, 0.1);
  color: var(--accent-pink);
}

.status-badge.locked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.masked-prediction {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

.points-earned-badge {
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Sidebar Standings */
.standings-card {
  position: sticky;
  top: 20px;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.standings-table th {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.standings-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.standings-table tr:last-child td {
  border-bottom: none;
}

.standings-table tr:hover td {
  background: rgba(255,255,255,0.01);
}

.rank-cell {
  font-weight: 700;
  width: 40px;
}

.rank-1 { color: var(--accent-gold); }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

.points-cell {
  font-weight: 700;
  color: var(--accent-teal);
}

.prize-cell {
  font-weight: 700;
  color: var(--accent-green);
  font-family: monospace;
}

/* Rule Card */
.rule-card {
  margin-top: 30px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.03), rgba(0, 255, 135, 0.03)), var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.rule-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.rule-bullet {
  color: var(--accent-teal);
  font-weight: bold;
}

/* Admin Panel Card */
.admin-card {
  margin-top: 30px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.admin-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.admin-match-row:last-child {
  border-bottom: none;
}

.admin-match-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-score-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-score-input {
  width: 45px;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: white;
  text-align: center;
  font-weight: 700;
  outline: none;
}

.admin-score-input:focus {
  border-color: var(--accent-pink);
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Footer & Backups */
footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
}

.backup-panel {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(255, 56, 96, 0.1);
  border: 1px solid rgba(255, 56, 96, 0.2);
  color: var(--accent-red);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-danger:hover {
  background: rgba(255, 56, 96, 0.25);
  border-color: rgba(255, 56, 96, 0.4);
  box-shadow: 0 0 10px rgba(255, 56, 96, 0.2);
}

/* Modal Popup Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: var(--transition-smooth);
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.close-modal-btn:hover {
  color: white;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-select {
  width: 100%;
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-family);
  font-size: 1rem;
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--accent-teal);
}

/* Animations */
@keyframes pulse-glow-teal {
  0% {
    filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.7));
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(0, 229, 255, 0.3));
  }
}

.pulse-yellow-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
  display: inline-block;
  margin-right: 6px;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(255, 215, 0, 0);
  }
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
  }
}

.pulse-green-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse-dot-green 1.5s infinite;
  display: inline-block;
  margin-right: 6px;
}

@keyframes pulse-dot-green {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(0, 255, 135, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(0, 255, 135, 0);
  }
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(0, 255, 135, 0);
  }
}

/* Visibility Control */
.reveal-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}
