/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Improve performance with better compositing */
.countdown-card,
.card-link {
  will-change: transform, box-shadow;
}

/* Reduce layout shifts with explicit dimensions */
.arrow-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}

/* Accessibility: Skip navigation link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #3b82f6;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  font-weight: 500;
}

.skip-link:focus {
  top: 6px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: #ffffff;
  min-height: 100vh;
  color: #1e293b;
  line-height: 1.6;
  font-display: swap; /* Improves font loading performance */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header styles */
.header {
  text-align: center;
  margin-bottom: 4rem;
  padding-top: 2rem;
}

.main-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #1d4ed8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  color: #64748b;
  margin-bottom: 1rem;
}

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
}

/* Card styles */
.countdown-card {
  background: #f8fafc;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.countdown-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
  border-radius: 16px 16px 0 0;
}

.countdown-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.25);
  background: #ffffff;
}

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

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.card-description {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.card-link:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

.card-link:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* Better focus indicators for cards */
.countdown-card:focus-within {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.arrow-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

/* Specific card colors */
.christmas {
  border-color: rgba(34, 197, 94, 0.2);
}

.christmas::before {
  background: linear-gradient(90deg, #22c55e, #16a34a, #15803d);
}

.christmas:hover {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 25px 50px -12px rgba(34, 197, 94, 0.25);
}

.year-end {
  border-color: rgba(168, 85, 247, 0.2);
}

.year-end::before {
  background: linear-gradient(90deg, #a855f7, #9333ea, #7c3aed);
}

.year-end:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 25px 50px -12px rgba(168, 85, 247, 0.25);
}

.election {
  border-color: rgba(239, 68, 68, 0.2);
}

.election::before {
  background: linear-gradient(90deg, #ef4444, #dc2626, #b91c1c);
}

.election:hover {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.25);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0 1rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  color: #64748b;
  font-size: 0.875rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header {
    margin-bottom: 2rem;
    padding-top: 1rem;
  }

  .countdown-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .countdown-card {
    padding: 2rem 1.5rem;
  }

  .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .countdown-card {
    padding: 1.5rem 1rem;
  }

  .card-title {
    font-size: 1.25rem;
  }
}
