/* Basic resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

:root {
  --bg-primary: #050505;
  --bg-radial: radial-gradient(circle at center, #141416 0%, #030303 100%);
  --color-text-main: #f0f0f3;
  --color-text-muted: #8e8e93;
  --color-accent: #ffffff;
  --color-accent-glow: rgba(255, 255, 255, 0.4);
  --glass-bg: rgba(18, 18, 20, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-family-serif: 'Cinzel', Georgia, serif;
  --font-family-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg-primary);
  background-image: var(--bg-radial);
  color: var(--color-text-main);
  font-family: var(--font-family-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Cosmic stars effect */
.stars-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(1.5px 1.5px at 15% 20%, rgba(255, 255, 255, 0.15) 100%, transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, 0.1) 100%, transparent),
    radial-gradient(2px 2px at 80% 40%, rgba(255, 255, 255, 0.12) 100%, transparent),
    radial-gradient(1.5px 1.5px at 60% 85%, rgba(255, 255, 255, 0.15) 100%, transparent),
    radial-gradient(1px 1px at 25% 55%, rgba(255, 255, 255, 0.08) 100%, transparent);
  background-size: 550px 550px;
  opacity: 0.7;
  z-index: 0;
}

/* Header styling */
.app-header {
  text-align: center;
  margin-top: 30px;
  z-index: 10;
  pointer-events: none;
  animation: fadeIn 1.5s ease-out;
}

.app-header h1 {
  font-family: var(--font-family-serif);
  font-weight: 400;
  letter-spacing: 0.15em;
  font-size: 1.8rem;
  text-transform: uppercase;
  color: var(--color-text-main);
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  margin-bottom: 6px;
}

.app-header .subtitle {
  font-weight: 300;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* Main canvas viewport */
.canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

#particleCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Quote Box Layout */
.quote-overlay {
  position: absolute;
  max-width: 500px;
  width: 90%;
  text-align: center;
  pointer-events: none;
  bottom: 22%; /* Positioned nicely above the controls */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 5;
  transition: opacity 0.8s ease-in-out;
}

.quote-text {
  font-family: var(--font-family-sans);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.quote-state {
  font-family: var(--font-family-serif);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 6px;
  width: 100px;
  transition: color 0.5s;
}

/* Glassmorphic Control Deck */
.control-deck {
  position: relative;
  width: 90%;
  max-width: 800px;
  margin-bottom: 40px;
  z-index: 10;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.deck-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  z-index: -1;
}

.deck-content {
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Play/Pause Area */
.playback-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn svg {
  transition: transform 0.2s;
}

.hidden {
  display: none !important;
}

.state-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Timeline/Slider Area */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.timeline-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.3s;
  cursor: pointer;
}

.timeline-slider:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Webkit track and thumb styling */
.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent-glow), 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.35);
  box-shadow: 0 0 15px #ffffff, 0 3px 6px rgba(0, 0, 0, 0.6);
}

/* Firefox track and thumb styling */
.timeline-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  border: none;
  box-shadow: 0 0 10px var(--color-accent-glow), 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-slider::-moz-range-thumb:hover {
  transform: scale(1.35);
  box-shadow: 0 0 15px #ffffff, 0 3px 6px rgba(0, 0, 0, 0.6);
}

/* Timeline Ticks */
.timeline-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.tick-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  transition: all 0.4s ease;
  position: relative;
  cursor: pointer;
}

.tick-label:hover {
  color: rgba(255, 255, 255, 0.7);
}

.tick-label.active {
  color: var(--color-accent);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsiveness adjustments */
@media (max-width: 600px) {
  .app-header h1 {
    font-size: 1.4rem;
  }
  .app-header .subtitle {
    font-size: 0.65rem;
  }
  .deck-content {
    padding: 16px 20px;
    gap: 15px;
  }
  .tick-label {
    font-size: 0.55rem;
    letter-spacing: 0.04em;
  }
  .quote-overlay {
    bottom: 24%;
  }
  .quote-text {
    font-size: 0.85rem;
  }
}
