/*
 * Advent Calendar Styles
 * 
 * THEME CUSTOMIZATION GUIDE:
 * ===========================
 * To adapt this calendar for different topics (e.g., Coding, Fitness, Learning):
 * 
 * 1. Update the CSS variables below with your color palette
 * 2. Change the emojis in the HTML files
 * 3. Update the site title and description in _config.yml
 * 4. Modify challenge content in challenges/dayXX.html files
 * 
 * COLOR PALETTE:
 * The current theme uses a Christmas-inspired palette:
 * - Primary: Red (#da2c38) - Main accent color
 * - Secondary: Deep Green (#226f54) - Secondary accent
 * - Light Green: (#87c38f) - Success/positive states
 * - Cream: (#f4f0bb) - Background highlights
 * - Brown: (#43291f) - Text and dark elements
 */

:root {
  /* Theme Colors */
  --color-primary: #FF3344;
  /* Red - Main accent */
  --color-primary-dark: #D62839;
  /* Darker red for hover states */
  --color-secondary: #064226;
  /* Deep green - Secondary accent */
  --color-secondary-dark: #064226;
  /* Darker green for hover */
  --color-accent: #87c38f;
  /* Light green - Success/completion */
  --color-accent-light: #a8d5ae;
  /* Very light green */
  --color-background: #f4f5f5;
  /* Cream - Background highlights */
  --color-dark: #43291f;
  /* Brown - Main text */
  --color-text: #43291f;
  /* Brown - Text color */
  --color-text-light: #6b4c3a;
  /* Lighter brown for secondary text */

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-gray-light: #f8f9fa;
  --color-gray: #e9ecef;
  --color-gray-dark: #999999;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(67, 41, 31, 0.1);
  --shadow-md: 0 4px 8px rgba(67, 41, 31, 0.15);
  --shadow-lg: 0 8px 16px rgba(67, 41, 31, 0.2);
  
  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 30px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ===========================
   RESET & BASE STYLES
   =========================== */

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

/* Ensure content doesn't overflow containers */
img,
canvas,
video {
  max-width: 100%;
  height: auto;
}

/* Word wrapping for text content */
p,
li,
span,
div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Prevent horizontal overflow */
body {
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--color-text);
  min-height: 100vh;
  padding: 2vh 2vw;
  position: relative;
}


.container {
  overflow-x: hidden;
}

/* Handle code and pre blocks */
pre,
code {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  color: var(--color-text);
  /* line-height: 1.6; */
  min-height: 100vh;
  padding: 2vh 2vw;
  position: relative;
}

/* Subtle top accent bar */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--color-primary) 0%, 
    var(--color-secondary) 25%,
    var(--color-accent) 50%,
    var(--color-secondary) 75%,
    var(--color-primary) 100%);
  z-index: 9999;
}

.container {
  position: relative;
  z-index: 1;
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  min-height: 90vh;
}

/* ===========================
   LOGIN MODAL
   =========================== */

/* Hide modal by default */
.login-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
  /* Explicitly prevent any filtering */
  filter: none !important;
  backdrop-filter: none !important;
}

/* Show modal instantly when needed */
.login-modal.show {
  display: block;
}

/* Blur background when modal is active */
body.modal-active .container {
  filter: blur(3px) brightness(0.7);
  pointer-events: none;
}

.login-modal-content {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  /* Ensure content is crisp and clear */
  filter: none !important;
  -webkit-font-smoothing: antialiased;
}

.login-modal h2 {
  color: var(--color-secondary);
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.login-modal p {
  color: var(--color-text);
  margin-bottom: 20px;
  line-height: 1.6;
}

.login-modal .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-modal label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text);
  font-weight: 600;
}

.login-modal input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.login-modal input:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.login-modal .error-message {
  color: var(--color-primary);
  margin-top: 10px;
  font-size: 0.9rem;
  display: none;
}

.login-modal .error-message.show {
  display: block;
}

.login-modal .secret-code-display {
  background: var(--color-background);
  border: 3px solid var(--color-secondary);
  border-radius: var(--radius-md);
  padding: 25px;
  margin: 20px 0;
}

.login-modal .secret-code-display h3 {
  color: var(--color-gray);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.login-modal .secret-code {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-primary);
  letter-spacing: 5px;
  margin: 15px 0;
  font-family: 'Courier New', monospace;
}

.login-modal .warning-text {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: var(--radius-sm);
  padding: 15px;
  margin: 15px 0;
  color: #856404;
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-modal .button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.login-modal .toggle-link {
  margin-top: 15px;
  color: var(--color-secondary);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
}

.login-modal .toggle-link:hover {
  color: var(--color-secondary-dark);
}

.btn-back-home {
  padding: 14px 28px;
  background: var(--color-gray-dark);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  flex: 1;
  font-family: var(--font-body);
}

.btn-back-home:hover {
  background: var(--color-gray-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.login-modal .button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.login-modal .button-group .btn,
.login-modal .button-group .btn-back-home {
  flex: 1;
  margin: 0;
}

/* ===========================
   HEADER
   =========================== */

header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--color-primary);
}

h1 {
  color: var(--color-primary);
  font-size: 2.8em;
  margin-bottom: 10px;
  font-weight: 700;
}

h1::before {
  content: "🎄 ";
}

h1::after {
  content: " 🎄";
}

.subtitle {
  color: var(--color-text-light);
  font-size: 1em;
}

/* ===========================
   NAVIGATION
   =========================== */

nav {
  width: 100%;
  max-width: 640px;
  margin: 30px auto 40px;
  padding: 14px;
  background: var(--color-gray-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  font-weight: 600;
  border: 2px solid transparent;
  letter-spacing: 0.01em;
}

nav a:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

nav a.active {
  background: var(--color-white);
  color: var(--color-secondary);
  border: 2px solid var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

nav a.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--color-accent-light), var(--shadow-md);
}

/* ===========================
   CONTENT
   =========================== */

.content {
  animation: fadeIn 0.5s ease;
}

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

/* ===========================
   FOOTER
   =========================== */

footer {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 2px solid var(--color-gray);
  color: var(--color-text-light);
}

.coffee-button-container {
  margin: 20px 0;
}

.coffee-button {
  display: inline-block;
  padding: 10px 24px;
  background: #FFDD00;
  color: #000000;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.coffee-button:hover {
  background: #FFED4E;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ===========================
   BUTTONS
   =========================== */

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--radius-full);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: 600;
}

.btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:disabled {
  background: var(--color-gray-dark);
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 12px 25px rgba(214, 40, 57, 0.2);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 16px 35px rgba(214, 40, 57, 0.25);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-secondary);
}

.btn-secondary:hover {
  background: var(--color-secondary-dark);
}

.btn-success {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-success:hover {
  background: var(--color-accent-light);
}

/* ===========================
   FORMS
   =========================== */

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  transition: border-color var(--transition-fast);
  font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ===========================
   ALERTS
   =========================== */

.alert {
  padding: 15px;
  margin: 15px 0;
  border-radius: var(--radius-sm);
  animation: slideIn 0.3s ease;
}

.alert-success {
  background: var(--color-accent-light);
  color: var(--color-secondary-dark);
  border: 2px solid var(--color-accent);
}

.alert-error {
  background: #fdecea;
  color: #8b1e1e;
  border: 2px solid var(--color-primary);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

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

/* ===========================
   WELCOME SECTION
   =========================== */

.welcome-section {
  margin: 30px 0 50px;
}

.welcome-hero {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-hero h1 {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 15px;
  line-height: 1.2;
}

.welcome-tagline {
  font-size: 1.2rem;
  color: var(--color-text-light);
  font-style: italic;
}

.welcome-content {
  display: grid;
  gap: 25px;
  margin-bottom: 40px;
}

.welcome-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-md);
  /* border-top: 3px solid var(--color-secondary); */
}

.welcome-card.motivational {
  background: linear-gradient(135deg, #f4f0bb 0%, #fff9e6 100%);
  border: 3px solid var(--color-primary);
}

.welcome-card h3 {
  font-size: 1.5rem;
  color: var(--color-secondary);
  margin-bottom: 15px;
}

.welcome-card p {
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 10px;
}

.welcome-card p:last-child {
  margin-bottom: 0;
}

.benefits-list {
  list-style: none;
  padding: 0;
}

.benefits-list li {
  padding: 12px 0;
  line-height: 1.6;
  border-bottom: 1px solid var(--color-gray);
}

.benefits-list li:last-child {
  border-bottom: none;
}

.highlight-text {
  background: var(--color-white);
  padding: 15px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.1rem;
  color: var(--color-secondary);
  margin-top: 15px;
}

/* ===========================
   COUNTDOWN TIMER
   =========================== */

.countdown-section {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 50px;
}

.countdown-section h2 {
  color: var(--color-white);
  font-size: 1.8rem;
  margin-bottom: 30px;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.countdown-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 20px 25px;
  min-width: 100px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  font-family: var(--font-heading);
}

.countdown-label {
  font-size: 0.5rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

.countdown-message {
  color: var(--color-gray-light);
  font-size: 1.1rem;
  font-weight: 500;
}

.countdown-complete {
  font-size: 2rem;
  color: var(--color-white);
  padding: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.calendar-title {
  text-align: center;
  color: var(--color-secondary);
  font-size: 2rem;
  margin-bottom: 30px;
}

/* ===========================
   LANDING PAGE CTA
   =========================== */

.landing-page {
  max-width: 1000px;
  margin: 0 auto;
}

.cta-section {
  text-align: center;
  margin: 50px 0;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(255, 51, 68, 0.05) 0%, rgba(6, 66, 38, 0.05) 100%);
  border-radius: var(--radius-lg);
}

.btn-cta {
  display: inline-block;
  padding: 18px 40px;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-lg);
  text-align: center;
  cursor: pointer;
  font-family: var(--font-heading);
}

.btn-cta-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border: 3px solid var(--color-primary);
}

.btn-cta-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(255, 51, 68, 0.3);
}

.btn-cta-primary:active {
  transform: translateY(-1px);
}

.cta-helper-text {
  margin-top: 15px;
  color: var(--color-text-light);
  font-size: 1rem;
  font-style: italic;
}

.calendar-header {
  text-align: center;
  margin-bottom: 40px;
}

.calendar-header h1 {
  color: var(--color-secondary);
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.calendar-subtitle {
  color: var(--color-text-light);
  font-size: 1.2rem;
  font-style: italic;
}

/* ===========================
   CALENDAR GRID
   =========================== */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 20px;
  margin-top: 30px;
}

.day-card {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.day-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  background: var(--color-primary-dark);
  border-color: var(--color-accent);
}

.day-card.golden-day {
  border: 3px rgba(255, 215, 0, 0.75);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2), 0 0 18px rgba(255, 215, 0, 0.4);
  background-image: linear-gradient(83deg, rgb(244 200 112 / 80%), rgb(240 227 92 / 80%));
  overflow: hidden;
}

.day-card.golden-day::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  opacity: 0;
  transform: translateX(-150%);
  pointer-events: none;
  transition: opacity var(--transition-normal);
  mix-blend-mode: screen;
}

.day-card.golden-day::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--radius-md) - 6px);
  border: 3px solid rgba(255, 215, 0, 0.75);
  box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.35);
  background: linear-gradient(140deg, rgba(255, 215, 0, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.day-card.golden-day:not(.locked):hover {
  transform: translateY(-10px) scale(1.05);
  border-color: #ffecb3;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.25), 0 0 28px rgba(255, 215, 0, 0.55);
}

.day-card.golden-day:not(.locked):hover::after {
  opacity: 1;
  animation: goldenShimmer 1.4s linear infinite;
}

.day-card.locked {
  background: var(--color-gray-dark);
  transform: translateY(-5px);
  opacity: 0.6;
}

.day-card.locked:hover {
  transform: none;
  box-shadow: var(--shadow-md);
  background: var(--color-gray-dark);
}

.day-card.golden-day.locked {
  opacity: 0.95;
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.26), 0 0 16px rgba(255, 215, 0, 0.35);
}

.day-card.golden-day.locked .lock-icon {
  color: #f7d476;
}

/* Completed day styling - opened advent box look */
.day-card.completed {
  background: radial-gradient(circle at center, var(--color-accent-light) 0%, var(--color-secondary) 100%);
  color: var(--color-white);
  border: 3px solid var(--color-primary);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(34, 111, 84, 0.4);
}

.day-card.completed.golden-day {
  border-color: #f7d476;
  box-shadow: 0 8px 24px rgba(135, 195, 143, 0.45), 0 0 20px rgba(255, 215, 0, 0.45);
}

.day-card.completed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, transparent 48%, var(--color-accent-light) 48%, var(--color-accent-light) 52%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, var(--color-accent-light) 48%, var(--color-accent-light) 52%, transparent 52%);
  background-size: 20px 20px;
  opacity: 0.1;
  pointer-events: none;
}

.day-card.completed:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 25px rgba(135, 195, 143, 0.4);
  border-color: var(--color-accent);
}

.day-card.completed .day-number {
  display: none;
}

.day-card.completed .day-label {
  display: none;
}

.day-card.completed .santa-image {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 2.5em;
  opacity: 0.9;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
  animation: bounce 2s ease-in-out infinite;
}

.day-card.completed .completion-badge {
  position: absolute;
  bottom: -5px;
  right: 5px;
  width: 95%;
  height: 95%;
  max-width: 150px;
  max-height: 150px;
  opacity: 0.95;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
  animation: bounce 2s ease-in-out infinite;
  object-fit: contain;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes goldenShimmer {
  from {
    transform: translateX(-150%);
  }
  to {
    transform: translateX(150%);
  }
}

.day-number {
  font-size: 3.5em;
  font-weight: 800;
  margin-bottom: 5px;
  color:  var(--color-white);
  z-index: 1;
  transition: all 0.3sease;
  font-family: 'Outfit', sans-serif;
  text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
}

.day-label {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lock-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.25em;
}

.star-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 1em;
}

.checkmark-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 1.5em;
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* ===========================
   INTRO SECTION
   =========================== */

.intro {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 2px solid var(--color-gray);
  border-top: 4px solid var(--color-secondary);
  box-shadow: var(--shadow-sm);
}

.intro h2 {
  color: var(--color-secondary);
  margin-bottom: 15px;
}

.intro p {
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ===========================
   FOOTER USER INFO
   =========================== */

.footer-user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--color-gray);
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.user-greeting {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.user-greeting strong {
  color: var(--color-text);
  font-weight: 500;
}

.secret-code-link-small {
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: transparent;
}

.secret-code-link-small:hover {
  color: var(--color-primary);
  background: var(--color-gray-light);
}

.logout-button {
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-light);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.logout-button:hover {
  color: var(--color-primary);
  background: var(--color-gray-light);
}

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

.leaderboard-container {
  max-width: 800px;
  margin: 0 auto;
}

.leaderboard-header {
  text-align: center;
  padding: 30px;
  background: var(--color-secondary);
  color: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: 30px;
}

.leaderboard-header h2 {
  font-size: 2.25em;
  margin-bottom: 10px;
  color: var(--color-white);
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab {
  padding: 12px 25px;
  background: var(--color-gray-light);
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
  color: var(--color-text);
}

.tab:hover {
  background: var(--color-gray);
}

.tab.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.leaderboard-table {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-gray);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px;
  padding: 20px;
  border-bottom: 1px solid var(--color-gray);
  align-items: center;
  transition: background var(--transition-fast);
}

.leaderboard-row:hover {
  background: var(--color-gray-light);
}

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

.leaderboard-header-row {
  background: var(--color-secondary);
  color: var(--color-white);
  font-weight: bold;
}

.leaderboard-header-row:hover {
  background: var(--color-secondary);
}

.rank {
  font-size: 1.25em;
  font-weight: bold;
  text-align: center;
}

.rank-1 { color: #ffd700; } /* Gold */
.rank-2 { color: #c0c0c0; } /* Silver */
.rank-3 { color: #cd7f32; } /* Bronze */

.rank-medal {
  font-size: 1.85em;
}

.username {
  font-size: 0.9em;
  font-weight: 500;
}

.score {
  text-align: right;
  font-size: 1em;
  font-weight: bold;
  color: var(--color-primary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.empty-state-icon {
  font-size: 3.6em;
  margin-bottom: 20px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--color-secondary);
  font-size: 1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--color-white);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-gray);
}

.stat-value {
  font-size: 2.2.5em;
  font-weight: bold;
  color: var(--color-primary);
}

.stat-label {
  color: var(--color-text-light);
  margin-top: 5px;
}

/* ===========================
   CHALLENGE PAGES
   =========================== */

.challenge-header {
  text-align: center;
  padding: 30px;
  background: var(--color-secondary);
  color: var(--color-white);
  border-radius: var(--radius-md);
  margin-bottom: 30px;
}

.challenge-header h2 {
  font-size: 2.25em;
  margin-bottom: 10px;
  color: var(--color-white);
}

.challenge-description {
  background: var(--color-white);
  padding: 25px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  line-height: 1.8;
  border: 2px solid var(--color-gray);
  border-top: 4px solid var(--color-secondary);
  box-shadow: var(--shadow-sm);
}

.challenge-description h3 {
  color: var(--color-secondary);
  margin-bottom: 15px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.leaderboard-preview {
  margin-top: 30px;
  padding: 20px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 2px solid var(--color-gray);
  border-top: 4px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.leaderboard-preview h3 {
  color: var(--color-primary);
  margin-bottom: 15px;
}

.leaderboard-preview ul {
  list-style: none;
  padding: 0;
}

.leaderboard-preview li {
  padding: 12px 15px;
  margin-bottom: 8px;
  background: var(--color-gray-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray);
  transition: all var(--transition-fast);
}

.leaderboard-preview li:hover {
  background: var(--color-white);
  transform: translateX(4px);
}

.leaderboard-preview .rank {
  font-weight: bold;
  color: var(--color-primary);
  margin-right: 10px;
  font-size: 0.85em;
}

/* ===========================
   INFO BOXES FOR CHALLENGES
   =========================== */

/* Info box with green accent - for "How it works" sections */
.info-box {
  background: rgba(135, 195, 143, 0.15);
  border: 1.5px solid var(--color-accent);
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 12px;
}

.info-box p {
  margin: 0;
}

.info-box ul,
.info-box ol {
  margin: 10px 0 0 0;
  padding-left: 20px;
}

/* Tip box with cream/yellow accent - for "Learning Tip", "Did you know", "Strategy Tips" sections */
.tip-box {
  background: rgba(244, 240, 187, 0.3);
  border: 1.5px solid var(--color-primary);
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 12px;
}

.tip-box p {
  margin: 0;
}

.tip-box ul,
.tip-box ol {
  margin: 10px 0 0 0;
  padding-left: 20px;
}

/* Educational content box - for "Learn More" sections after challenge completion */
.learn-more-box {
  background: linear-gradient(135deg, rgba(34, 111, 84, 0.05) 0%, rgba(135, 195, 143, 0.1) 100%);
  border: 2px solid var(--color-secondary);
  padding: 25px;
  margin: 30px 0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.learn-more-box h3 {
  color: var(--color-secondary);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.learn-more-box p {
  margin: 12px 0;
  line-height: 1.7;
}

.learn-more-box ul {
  margin: 10px 0;
  padding-left: 25px;
}

.learn-more-box li {
  margin: 8px 0;
  line-height: 1.6;
}

/* NGO spotlight box */
.ngo-spotlight {
  background: linear-gradient(135deg, rgba(218, 44, 56, 0.05) 0%, rgba(244, 240, 187, 0.15) 100%);
  border: 2px solid var(--color-primary);
  padding: 25px;
  margin: 30px 0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}

.ngo-spotlight h3 {
  grid-column: 1 / -1;
  color: var(--color-primary);
  margin: 0 0 15px 0;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ngo-logo {
  max-width: 160px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ngo-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ngo-content h4 {
  margin: 0;
  color: var(--color-dark);
  font-size: 1.2em;
}

.ngo-content p {
  margin: 0;
  line-height: 1.7;
}

.ngo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.ngo-link:hover {
  color: var(--color-secondary);
  gap: 12px;
}

/* Responsive adjustments for educational sections */
@media (max-width: 768px) {
  .ngo-spotlight {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .ngo-logo {
    max-width: 120px;
    max-height: 100px;
    margin: 0 auto;
  }
  
  .learn-more-box,
  .ngo-spotlight {
    padding: 20px;
  }
}

/* ===========================
   CHALLENGE SPECIFIC STYLES
   =========================== */

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-text);
}

.score-display {
  text-align: center;
  font-size: 2.8em;
  color: var(--color-white);
  font-weight: bold;
  margin: 20px 0;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
  body {
    padding: 1vh 1vw;
  }

  .container {
    padding: 15px;
    border-radius: var(--radius-sm);
  }
  
  .footer-user-info {
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
  
  .user-greeting {
    font-size: 0.85rem;
  }
  
  .secret-code-link-small {
    font-size: 0.85rem;
  }
  
  h1 {
    font-size: 1.5em;
  }
  
  .subtitle {
    font-size: 0.9em;
  }

  /* Welcome section responsive */
  .welcome-hero h1 {
    font-size: 1.8rem;
  }

  .welcome-tagline {
    font-size: 1rem;
  }

  .welcome-card {
    padding: 20px;
  }

  .welcome-card h3 {
    font-size: 1.3rem;
  }

  .countdown-section {
    padding: 30px 20px;
  }

  .countdown-section h2 {
    font-size: 1.4rem;
  }

  .countdown-timer {
    gap: 10px;
  }

  .countdown-item {
    min-width: 70px;
    padding: 15px 10px;
  }

  .countdown-number {
    font-size: 2rem;
  }

  .countdown-label {
    font-size: 0.75rem;
  }

  .countdown-message {
    font-size: 0.95rem;
  }

  .calendar-title {
    font-size: 1.5rem;
  }

  /* Landing page responsive */
  .btn-cta {
    font-size: 1.1rem;
    padding: 16px 30px;
  }

  .cta-section {
    padding: 30px 15px;
    margin: 30px 0;
  }

  .calendar-header h1 {
    font-size: 1.8rem;
  }

  .calendar-subtitle {
    font-size: 1rem;
  }
  
  .calendar-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .day-number {
    font-size: 2em;
    margin-bottom: 5px;
  }
  
  .day-label {
    font-size: 0.7em;
  }
  
  .leaderboard-row {
    grid-template-columns: 50px 1fr 70px;
    padding: 12px 8px;
    font-size: 0.9em;
  }
  
  .rank {
    font-size: 1.1em;
  }
  
  .username {
    font-size: 0.85em;
  }
  
  .score {
    font-size: 0.9em;
  }
  
  nav {
    padding: 12px;
    margin: 25px auto 30px;
  }

  .nav-links {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }

  nav a {
    min-height: 48px;
    font-size: 0.95em;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9em;
  }
  
  header {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }
  
  .intro {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .intro h2 {
    font-size: 1.2em;
  }
  
  .intro p {
    font-size: 0.9em;
  }
  
  .login-modal-content {
    padding: 25px;
  }
  
  .login-modal h2 {
    font-size: 1.4em;
  }
}

/* Additional mobile breakpoint for very small screens */
@media (max-width: 480px) {
  body {
    padding: 0.5vh 1vw;
  }

  .container {
    padding: 10px;
    border-radius: var(--radius-sm);
  }
  
  .footer-user-info {
    font-size: 0.8rem;
    gap: 6px;
  }
  
  .user-greeting {
    font-size: 0.8rem;
  }
  
  .secret-code-link-small {
    font-size: 0.8rem;
  }
  
  h1 {
    font-size: 1.3em;
  }
  
  h1::before,
  h1::after {
    font-size: 0.8em;
  }
  
  .subtitle {
    font-size: 0.85em;
  }
  
  .calendar-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }
  
  .day-number {
    font-size: 1.8em;
    margin-bottom: 3px;
  }
  
  .day-label {
    font-size: 0.55em;
  }
  
  .day-card.completed .completion-badge {
    width: 90%;
    height: 90%;
  }
  
  nav {
    padding: 10px;
    margin: 20px auto 25px;
  }

  .nav-links {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }

  nav a {
    min-height: 44px;
    font-size: 0.9em;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.85em;
  }
  
  .intro {
    padding: 12px;
    margin-bottom: 15px;
  }
  
  .intro h2 {
    font-size: 1.1em;
  }
  
  .intro p {
    font-size: 0.85em;
  }
  
  .login-modal-content {
    padding: 20px;
    width: 95%;
  }
  
  .login-modal h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
  }
  
  .login-modal p {
    font-size: 0.9em;
  }
  
  .login-modal input {
    padding: 10px;
    font-size: 0.9em;
  }
  
  .secret-code {
    font-size: 1.5em;
    letter-spacing: 3px;
  }
  
  .leaderboard-row {
    grid-template-columns: 40px 1fr 60px;
    padding: 10px 6px;
    font-size: 0.85em;
  }
  
  .rank {
    font-size: 1em;
  }
  
  .username {
    font-size: 0.8em;
  }
  
  .score {
    font-size: 0.85em;
  }
  
  .rank-medal {
    font-size: 1.5em;
  }
  
  .leaderboard-header h2 {
    font-size: 1.6em;
  }
  
  .tabs {
    gap: 6px;
  }
  
  .tab {
    padding: 8px 15px;
    font-size: 0.85em;
  }
}

/* Interactive Form Controls */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: var(--color-gray);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--color-primary-dark);
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb:hover {
  background: var(--color-primary-dark);
  transform: scale(1.1);
}

input[type="number"] {
  padding: 8px;
  border: 2px solid var(--color-gray);
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
}
