/* ===========================
   FONT IMPORTS
=========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* ===========================
   ROOT VARIABLES
=========================== */
:root {
  --primary: #1E3A8A;       /* Deep Blue */
  --secondary: #3B82F6;     /* Sky Blue */
  --accent: #A3E635;        /* Lime */
  --background: #F8FAFC;    /* Off-White */
  --text: #1F2937;          /* Charcoal */
}

/* ===========================
   GLOBAL STYLES
=========================== */
body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.4rem;
  text-align: center;
}

h2 {
  font-size: 1.6rem;
}

p, li {
  font-size: 1.05rem;
}

ul {
  margin-left: 1.2rem;
}

hr {
  border: none;
  border-top: 1px solid #dbe1e8;
  margin: 2rem 0;
}

/* ===========================
   RULES PAGE CONTAINER
=========================== */
.rules-container {
  max-width: 850px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.rules-intro {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ===========================
   LINKS
=========================== */
a {
  color: var(--secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   MONO NUMBERS (OPTIONAL)
=========================== */
.counter, .timestamp {
  font-family: 'Roboto Mono', monospace;
  color: var(--primary);
  font-size: 1.2rem;
}

/* ===========================
   HEADER & LOGO (Centered, No Background)
=========================== */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background-color: transparent; /* no blue background */
  color: var(--primary);
  text-align: center;
  width: 100%;
}

header img {
  height: 288px; /* large logo */
  max-width: 100%;
  margin-bottom: 1rem;
}

nav {
  margin-top: 1rem;
}

nav a {
  margin: 0 1rem;
  color: var(--primary); /* deep blue links */
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
}

nav a:hover {
  color: var(--secondary); /* sky blue hover */
  text-decoration: underline;
}

.logo-crop {
  height: 96px; /* show only middle third of 288px logo */
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
}

.logo-crop img {
  position: relative;
  top: -96px; /* shift up by one third */
  height: 288px;
}

/* ===========================
   HERO SECTION
=========================== */
.hero {
  text-align: center;
  padding: 3rem 2rem;
  background-color: var(--background);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.counter-box {
  font-family: 'Roboto Mono', monospace;
  font-size: 2rem;
  color: var(--primary);
  background: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.prize-pot-box {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.6rem;
  color: var(--secondary);
  background: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  display: inline-block;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}


/* ===========================
   CTA BUTTON
=========================== */
.cta-button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--secondary);
  color: white;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.cta-button:hover {
  background-color: var(--accent);
  color: var(--text);
}

/* ===========================
   FOOTER
=========================== */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  color: #6b7280;
}

/* ================================
   SUBMIT PREDICTION PAGE STYLING
   ================================ */

.submit-container {
  max-width: 700px;
  margin: 60px auto;
  padding: 40px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
}

.submit-container h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: #222;
}

.submit-container p {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 30px;
}

/* Form styling */
.prediction-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.prediction-form label {
  font-weight: bold;
  color: #333;
}

.prediction-form input[type="email"],
.prediction-form input[type="datetime-local"] {
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.prediction-form input:focus {
  border-color: #0077ff;
  outline: none;
}

/* Submit button matches your CTA button */
.prediction-form .cta-button {
  display: inline-block;
  padding: 14px 20px;
  background: #0077ff;
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.prediction-form .cta-button:hover {
  background: #005fcc;
}

/* Status message */
.status-message {
  margin-top: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #0077ff;
}

/* Make it responsive */
@media (max-width: 600px) {
  .submit-container {
    padding: 25px;
  }
}

/* ================================
   POPUP MODAL
   ================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-box {
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: popupFade 0.25s ease-out;
}

.modal-box p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  white-space: pre-line; /* allows \n line breaks */
}

@keyframes popupFade {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ================================
   LEADERBOARD
   ================================ */

.leaderboard-container {
  max-width: 900px;
  margin: 60px auto;
  padding: 20px;
  text-align: center;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.leaderboard-table th {
  background: #f7f7f7;
  font-weight: bold;
}

.leaderboard-table tr:nth-child(even) {
  background: #fafafa;
}

.leaderboard-table tr:hover {
  background: #f0f8ff;
}

.winner-banner {
  background: #fff7d6;
  padding: 20px;
  border-radius: 10px;
  margin: 25px 0;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stats-box {
  background: #ffffff;
  padding: 25px;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
}

.prize-amount {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.progress-wrapper {
  width: 100%;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  margin: 15px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #4caf50;
  transition: width 0.4s ease;
}

.cta-section {
  margin-top: 30px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.cta-button.secondary {
  background: #ddd;
  color: #333;
}

/* Container */
.home-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.title {
  margin-bottom: 30px;
}

.loading-text {
  text-align: center;
  margin-top: 50px;
}

/* Winner Banner */
.winner-banner {
  background: none;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 35px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Stats Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.stat-item {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.stat-item h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #444;
}

.stat-item p {
  font-size: 1.8rem;
  font-weight: bold;
  color: #222;
}

/* Progress Bar */
.progress-wrapper {
  width: 100%;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  margin: 15px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #4caf50;
  transition: width 0.4s ease;
}

.progress-text {
  margin-bottom: 30px;
  font-weight: 500;
}

/* CTA Buttons */
.cta-section {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.cta-button {
  padding: 12px 20px;
  background: #0070f3;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.cta-button.secondary {
  background: #ddd;
  color: #333;
}

/* Container */
.home-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.title {
  margin-bottom: 30px;
}

.loading-text {
  text-align: center;
  margin-top: 50px;
}

/* Winner Banner */
.winner-banner {
  background: #fff7d6;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 35px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Stats Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.stat-item {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.stat-item h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #444;
}

.stat-item p {
  font-size: 1.8rem;
  font-weight: bold;
  color: #222;
}

/* Progress Bar */
.progress-wrapper {
  width: 100%;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  margin: 15px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #4caf50;
  transition: width 0.4s ease;
}

.progress-text {
  margin-bottom: 30px;
  font-weight: 500;
}

/* Traffic Graph */
.traffic-graph {
  margin: 40px auto;
  max-width: 900px;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* CTA Buttons */
.cta-section {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.cta-button {
  padding: 12px 20px;
  background: #0070f3;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.cta-button.secondary {
  background: #ddd;
  color: #333;
}

/* Container */
.confirm-container {
  max-width: 480px;
  margin: 60px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  font-family: inherit;
}

/* Headings */
.confirm-container h1 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: center;
  color: #222;
}

/* Info box */
.info-box {
  background: #f7f9fc;
  border-left: 4px solid #4a90e2;
  padding: 15px;
  margin: 20px 0;
  border-radius: 6px;
  color: #333;
  line-height: 1.5;
}

/* Labels */
.confirm-container label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

/* Input */
.confirm-container input[type="email"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.confirm-container input[type="email"]:focus {
  border-color: #4a90e2;
  outline: none;
}

/* Button */
.confirm-container button {
  width: 100%;
  padding: 12px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.confirm-container button:hover {
  background: #3a78c2;
}

/* Success message */
.confirm-container p {
  margin: 10px 0;
  color: #444;
  line-height: 1.5;
  text-align: center;
}