/* Events Page Styles - Bright Holographic Theme with Countdown UI */

/* ==================== CONTAINER ==================== */

.events-container {
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 50%, #fce7f3 100%);
  padding-bottom: 5rem;
  position: relative;
}

.events-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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

.events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.events-header .back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #6366f1;
  text-decoration: none;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  transition: all 0.2s ease;
}

.events-header .back-link:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateX(-2px);
}

.events-header .header-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.events-header .header-actions {
  width: 40px;
}

/* ==================== EVENT BANNER (Featured Event) ==================== */

.event-banner {
  position: relative;
  margin: 1rem;
  padding: 1.75rem;
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.2);
}

.event-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--event-primary, #6366f1), var(--event-secondary, #ec4899));
  z-index: 0;
}

.event-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: 0;
}

.event-banner-content {
  position: relative;
  z-index: 1;
}

.event-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  backdrop-filter: blur(4px);
}

.event-banner-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.event-banner-emoji {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.event-banner-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.625rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-banner-description {
  font-size: 1rem;
  opacity: 0.95;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.event-banner-dates {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  opacity: 0.9;
  font-weight: 500;
}

.event-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.875rem 2rem;
  background: #fff;
  color: var(--event-primary, #6366f1);
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.event-banner-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* ==================== COUNTDOWN (Time Attack UI) ==================== */

.event-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  margin-top: 1.25rem;
  backdrop-filter: blur(4px);
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  min-width: 60px;
}

.countdown-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.countdown-label {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  margin-top: 0.375rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.countdown-separator {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

/* ==================== EVENT LIST ==================== */

.events-section {
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.events-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.events-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==================== EVENT CARD ==================== */

.event-card {
  background: white;
  border-radius: 20px;
  padding: 1.25rem;
  border: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--event-primary, #6366f1), var(--event-secondary, #ec4899));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.event-card:hover::before {
  opacity: 1;
}

.event-card.active {
  border-color: rgba(99, 102, 241, 0.3);
}

.event-card.active::before {
  opacity: 1;
}

.event-card.past {
  opacity: 0.6;
}

.event-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.event-card-emoji {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.event-card-info {
  flex: 1;
}

.event-card-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.0625rem;
  margin-bottom: 0.375rem;
}

.event-card-dates {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.event-card-description {
  font-size: 0.9375rem;
  color: #475569;
  line-height: 1.6;
}

.event-card-status {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-card-status.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
  color: #059669;
}

.event-card-status.upcoming {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  color: #6366f1;
}

.event-card-status.ended {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.event-card-rewards {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(99, 102, 241, 0.08);
  flex-wrap: wrap;
}

.event-reward {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.08));
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #6366f1;
  font-weight: 600;
}

/* ==================== CALENDAR VIEW ==================== */

.events-calendar {
  background: white;
  border-radius: 20px;
  padding: 1.25rem;
  margin: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-month {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.0625rem;
}

.calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.08);
  border: none;
  border-radius: 10px;
  color: #6366f1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: rgba(99, 102, 241, 0.15);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.375rem;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.5rem 0;
  text-transform: uppercase;
  font-weight: 600;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  color: #64748b;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  font-weight: 500;
}

.calendar-day:hover {
  background: rgba(99, 102, 241, 0.08);
}

.calendar-day.today {
  color: #6366f1;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.1);
}

.calendar-day.has-event {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  color: #1e293b;
  font-weight: 600;
}

.calendar-day.other-month {
  opacity: 0.3;
}

/* ==================== HOMEPAGE BANNER ==================== */

.homepage-event-banner {
  margin: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--event-primary, #6366f1), var(--event-secondary, #ec4899));
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.homepage-event-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.homepage-event-banner .dismiss-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.homepage-event-banner .dismiss-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
}

.homepage-event-emoji {
  font-size: 2.25rem;
}

.homepage-event-info {
  flex: 1;
}

.homepage-event-title {
  font-weight: 700;
  font-size: 1rem;
}

.homepage-event-subtitle {
  font-size: 0.8125rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.homepage-event-arrow {
  font-size: 1.5rem;
  opacity: 0.8;
}

/* ==================== EMPTY STATE ==================== */

.events-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin: 1rem;
}

.events-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.events-empty-text {
  color: #64748b;
  font-size: 0.9375rem;
}

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

.events-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  background: white;
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.events-nav .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.events-nav .nav-link:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.events-nav .nav-link.active {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.events-nav .nav-icon {
  font-size: 1.25rem;
}

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

@media (min-width: 768px) {
  .events-container {
    max-width: 700px;
    margin: 0 auto;
  }

  .events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .countdown-unit {
    min-width: 70px;
    padding: 1rem 1.25rem;
  }

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