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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #fff;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  animation: header-glow 4s ease-in-out infinite;
}

@keyframes header-glow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(145, 70, 255, 0.5), 0 0 20px rgba(145, 70, 255, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(145, 70, 255, 0.8), 0 0 40px rgba(255, 107, 157, 0.5), 0 0 60px rgba(145, 70, 255, 0.3);
  }
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.streamer-name {
  color: #9146ff;
  font-size: 1.2rem;
  font-weight: 600;
}

.status-card,
.progress-card,
.history-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

@keyframes card-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(145, 70, 255, 0.3), 0 0 30px rgba(145, 70, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(145, 70, 255, 0.5), 0 0 50px rgba(255, 107, 157, 0.3), 0 0 70px rgba(145, 70, 255, 0.2);
  }
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #666;
  animation: pulse 2s infinite;
}

.status-indicator.live .status-dot {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444;
}

.status-indicator.offline .status-dot {
  background: #666;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.current-session {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.current-session p {
  font-size: 1.1rem;
}

#session-duration {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  color: #4ade80;
}

.progress-card h2,
.history-card h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

.progress-bar {
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #9146ff, #ff6b9d);
  border-radius: 12px;
  transition: width 0.5s ease-out;
  width: 0%;
  position: relative;
  overflow: hidden;
}

.progress-fill.live {
  animation: pulse-glow 2s ease-in-out infinite;
}

.progress-fill.live::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(145, 70, 255, 0.7), 0 0 20px rgba(255, 107, 157, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(145, 70, 255, 1), 0 0 50px rgba(255, 107, 157, 0.7), 0 0 70px rgba(145, 70, 255, 0.4);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 1.1rem;
}

#time-streamed {
  color: #4ade80;
  font-weight: 600;
}

#goal-time {
  color: rgba(255, 255, 255, 0.6);
}

.progress-percent {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: #9146ff;
}

#session-list {
  list-style: none;
  max-height: 16.875rem;
  overflow-y: auto;
  padding-right: 0.75rem;
  scrollbar-width: auto;
  scrollbar-color: rgba(145, 70, 255, 0.5) transparent;
}

#session-list::-webkit-scrollbar {
  width: 1.25rem;
}

#session-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 0.25rem 0;
}

#session-list::-webkit-scrollbar-thumb {
  background: rgba(145, 70, 255, 0.5);
  border-radius: 0.625rem;
  border: 0.125rem solid transparent;
  background-clip: content-box;
}

#session-list::-webkit-scrollbar-thumb:hover {
  background: rgba(145, 70, 255, 0.7);
  border: 0.125rem solid transparent;
  background-clip: content-box;
}

#session-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
}

#session-list li:last-child {
  border-bottom: none;
}

.session-date {
  color: rgba(255, 255, 255, 0.6);
}

.session-duration {
  color: #4ade80;
  font-weight: 600;
}

/* Goal reached state */
.progress-fill.complete {
  background: linear-gradient(90deg, #4ade80, #22c55e);
}

.progress-percent.complete {
  color: #4ade80;
}

/* Calendar styles */
.calendar-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

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

.calendar-header h2 {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.calendar-nav {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.calendar-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 0.5rem 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  --fill-percent: 0%;
}

.calendar-day.current-month {
  color: rgba(255, 255, 255, 0.8);
}

.calendar-day.today {
  border: 2px solid #9146ff;
}

/* Percentage fill for partial days */
.calendar-day.partial::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--fill-percent);
  background: linear-gradient(to top, rgba(251, 191, 36, 0.5), rgba(251, 191, 36, 0.25));
  z-index: 1;
  transition: height 0.3s ease;
  border-radius: 0 0 6px 6px;
}

.calendar-day.partial {
  background: rgba(255, 255, 255, 0.05);
  color: #fbbf24;
}

.calendar-day .day-number {
  position: relative;
  z-index: 2;
}

.calendar-day.goal-met {
  background: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.calendar-day.none {
  background: rgba(255, 255, 255, 0.05);
}

/* Calendar legend */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-dot.goal-met {
  background: rgba(74, 222, 128, 0.5);
}

.legend-dot.partial {
  background: rgba(251, 191, 36, 0.5);
}

.legend-dot.none {
  background: rgba(255, 255, 255, 0.1);
}

/* Fireworks canvas */
#fireworks-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* Enhanced glow when goal is met */
.goal-met-celebration .status-card,
.goal-met-celebration .progress-card,
.goal-met-celebration .history-card,
.goal-met-celebration .calendar-card {
  animation: celebration-glow 1.5s ease-in-out infinite;
}

@keyframes celebration-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5), 0 0 40px rgba(74, 222, 128, 0.3), 0 0 60px rgba(74, 222, 128, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.7), 0 0 60px rgba(74, 222, 128, 0.5), 0 0 90px rgba(255, 215, 0, 0.3);
  }
}

/* Progress bar glow */
.progress-bar {
  animation: progress-bar-glow 3s ease-in-out infinite;
  animation-delay: 0.25s;
}

@keyframes progress-bar-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(145, 70, 255, 0.2), inset 0 0 5px rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow: 0 0 20px rgba(145, 70, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.1);
  }
}

/* Calendar day glow */
.calendar-day.goal-met {
  animation: day-glow 2s ease-in-out infinite;
}

@keyframes day-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(74, 222, 128, 0.3);
  }
  50% {
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6), 0 0 20px rgba(74, 222, 128, 0.2);
  }
}

/* Status dot enhanced glow */
.status-indicator.live .status-dot {
  animation: live-dot-glow 1.5s ease-in-out infinite;
}

@keyframes live-dot-glow {
  0%, 100% {
    box-shadow: 0 0 10px #ff4444, 0 0 20px rgba(255, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 20px #ff4444, 0 0 40px rgba(255, 68, 68, 0.7), 0 0 60px rgba(255, 68, 68, 0.3);
  }
}
