.predictive-caching-demo {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.demo-header {
  text-align: center;
  margin-bottom: 30px;
}

.demo-header h2 {
  color: #333;
  margin-bottom: 10px;
  font-size: 2rem;
}

.demo-header p {
  color: #666;
  font-size: 1.1rem;
}

.demo-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.demo-controls button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
}

.simulation-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.simulation-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.simulation-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.refresh-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.clear-btn {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.clear-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.demo-stats {
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.stat-card h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
}

.stat-label {
  color: #666;
  font-size: 14px;
}

.stat-value {
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

.demo-sections {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.section h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.3rem;
}

.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.song-card {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.song-card:hover {
  background: #e3f2fd;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.song-card.current {
  border-color: #2196F3;
  background: #e3f2fd;
}

.song-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.song-artist {
  color: #666;
  font-size: 14px;
  margin-bottom: 5px;
}

.song-duration {
  color: #999;
  font-size: 12px;
}

.predictions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prediction-card {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #2196F3;
}

.prediction-rank {
  font-weight: 700;
  color: #2196F3;
  margin-right: 15px;
  min-width: 30px;
}

.prediction-info {
  flex: 1;
}

.prediction-song {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.prediction-details {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.prediction-reason {
  padding: 2px 8px;
  border-radius: 12px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.prediction-priority,
.prediction-confidence {
  font-size: 12px;
  color: #666;
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 12px;
}

.prediction-eta {
  font-size: 12px;
  color: #999;
  text-align: right;
  min-width: 80px;
}

.no-predictions {
  text-align: center;
  padding: 40px;
  color: #666;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.insight-card {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #4CAF50;
}

.insight-card h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.1rem;
}

.insight-card p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

.analyzing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.analyzing-spinner {
  font-size: 3rem;
  animation: spin 2s linear infinite;
  margin-bottom: 20px;
}

.analyzing-overlay p {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

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

/* Responsive design */
@media (max-width: 768px) {
  .predictive-caching-demo {
    padding: 15px;
  }
  
  .demo-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .demo-controls button {
    width: 100%;
    max-width: 300px;
  }
  
  .stat-grid {
    grid-template-columns: 1fr;
  }
  
  .songs-grid {
    grid-template-columns: 1fr;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
  }
  
  .prediction-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .prediction-eta {
    text-align: left;
    min-width: auto;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .predictive-caching-demo {
    background: #121212;
    color: #e0e0e0;
  }
  
  .demo-header h2 {
    color: #e0e0e0;
  }
  
  .demo-header p {
    color: #b0b0b0;
  }
  
  .stat-card,
  .section {
    background: #1e1e1e;
    border-color: #333;
  }
  
  .stat-card h3,
  .section h3 {
    color: #e0e0e0;
  }
  
  .stat-item {
    background: #2a2a2a;
  }
  
  .stat-label {
    color: #b0b0b0;
  }
  
  .stat-value {
    color: #e0e0e0;
  }
  
  .song-card,
  .prediction-card,
  .insight-card {
    background: #2a2a2a;
  }
  
  .song-card:hover {
    background: #333;
  }
  
  .song-card.current {
    background: #1a237e;
  }
  
  .song-title,
  .prediction-song,
  .insight-card h4 {
    color: #e0e0e0;
  }
  
  .song-artist,
  .insight-card p {
    color: #b0b0b0;
  }
  
  .prediction-priority,
  .prediction-confidence {
    background: #333;
    color: #b0b0b0;
  }
}