/* Chunked Video Player Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #fff;
}

.container {
  max-width: 1200px;
  width: 100%;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 25px;
  font-size: 0.95rem;
}

/* Stats Section */
.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.stat-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  min-width: 120px;
  text-align: center;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.stat-item.hit {
  border-color: rgba(102, 234, 126, 0.5);
}

.stat-item.miss {
  border-color: rgba(234, 102, 102, 0.5);
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
}

.stat-item.hit .stat-value {
  color: #66ea7e;
}

.stat-item.miss .stat-value {
  color: #ea6666;
}

/* Player Wrapper */
.player-wrapper {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#videoPlayer {
  width: 100%;
  border-radius: 12px;
  background: #000;
  display: block;
}

/* Controls */
.controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.progress-container {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  overflow: visible;
}

.progress-buffered {
  position: absolute;
  height: 100%;
  background: rgba(102, 126, 234, 0.3);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.1s ease;
}

/* Chunk Indicators */
.cache-indicators {
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 14px;
  display: flex;
}

.chunk-indicator {
  height: 100%;
  border-radius: 2px;
  margin-right: 1px;
  transition: all 0.3s ease;
  position: relative;
}

.chunk-indicator.cached {
  background: linear-gradient(135deg, #66ea7e 0%, #4ecdc4 100%);
}

.chunk-indicator.loading {
  background: rgba(234, 179, 102, 0.8);
  animation: pulse 1s infinite;
}

.chunk-indicator.pending {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Control Buttons */
.control-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Select Dropdown */
select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

select option {
  background: #302b63;
  color: white;
}

/* Time Display */
.time-display {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 120px;
}

/* Loading Indicator */
.loading {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Legend */
.legend {
  margin-top: 15px;
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.legend-box.cached {
  background: linear-gradient(135deg, #66ea7e 0%, #4ecdc4 100%);
}

.legend-box.loading {
  background: rgba(234, 179, 102, 0.8);
}

.legend-box.pending {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  .stats { gap: 10px; }
  .stat-item { padding: 10px 14px; min-width: 100px; }
  .control-buttons { gap: 10px; }
  button { padding: 10px 16px; font-size: 0.85rem; }
}
