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

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

.container {
  text-align: center;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #e94560, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #888;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.drop-zone {
  border: 3px dashed #444;
  border-radius: 16px;
  padding: 4rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(233, 69, 96, 0.05) 10px,
    rgba(233, 69, 96, 0.05) 20px
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drop-zone.drag-over {
  border-color: #e94560;
  background: rgba(233, 69, 96, 0.1);
  transform: scale(1.02);
}

.drop-zone.drag-over::before {
  opacity: 1;
}

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

.upload-icon {
  color: #e94560;
  margin-bottom: 1rem;
}

.drop-text {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.drop-hint {
  color: #666;
  font-size: 0.9rem;
}

.fallback-btn {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 2px solid #444;
  color: #888;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.fallback-btn:hover {
  border-color: #e94560;
  color: #e94560;
}

.error-message {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.95rem;
}

.error-message:empty {
  display: none;
}

.result-container {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid #22c55e;
  border-radius: 16px;
}

.result-container h2 {
  color: #86efac;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.bpm-value {
  font-size: 5rem;
  font-weight: bold;
  color: #22c55e;
  line-height: 1.3;
  word-break: break-word;
}

.bpm-value .bpm-top {
  display: block;
  font-size: 4rem;
  margin-bottom: 0.25rem;
}

.bpm-value .key-bottom {
  display: block;
  font-size: 1.75rem;
  color: #86efac;
  opacity: 0.9;
}

.bpm-value.pulse {
  animation: pulse 0.3s ease-out;
}

/* Greyed out styling for undetectable results */
.bpm-value.greyed-out {
  color: #666;
  opacity: 0.5;
}

.greyed-out {
  color: #999;
  font-style: italic;
}

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

.metadata-container {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(34, 197, 94, 0.3);
}

.metadata-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.metadata-label {
  color: #86efac;
  font-weight: 500;
}

.metadata-value {
  color: #a7f3d0;
}

.loading-spinner {
  margin-top: 2rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(233, 69, 96, 0.2);
  border-top-color: #e94560;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner p {
  color: #888;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  .drop-zone {
    padding: 3rem 1.5rem;
  }
  
  .bpm-value {
    font-size: 4rem;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .drop-text {
    font-size: 1.1rem;
  }
  
  .bpm-value {
    font-size: 3rem;
    word-break: break-word;
    line-height: 1.4;
  }
}

/* Waveform container styling */
.waveform-container {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  overflow: hidden;
}

#waveform-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Track title styling */
.track-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
  word-break: break-word;
  line-height: 1.3;
}

/* Responsive adjustments for waveform */
@media (max-width: 768px) {
  .waveform-container {
    padding: 0.5rem;
  }
  
  #waveform-canvas {
    max-width: 100%;
  }
}
