@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* Reset and base styles to eliminate extra margins */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  height: auto;
  overflow: hidden;
}

.player-container {
  width: 100%;
  max-width: 700px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  padding: 15px;
  margin: 0;
  height: fit-content;
  overflow: hidden;
}

video {
  width: 100%;
  height: 0px;
  display: block;
  margin: 0;
  padding: 0;
}

/* Two-row layout for controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.controls button,
.controls select {
  background: #16c4e3;
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.controls button:hover,
.controls select:hover {
  background: #FE4980;
}

/* First row: Progress container */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  order: 1;
}

/* Second row: Controls row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  order: 2;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #16c4e3;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #16c4e3;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.time {
  font-size: 12px;
  min-width: 85px;
  text-align: center;
  white-space: nowrap;
  font-family: 'Poppins', sans-serif;
  color: #333;
  font-weight: 500;
}

.right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.volume-container {
  display: flex;
  align-items: center;
  position: relative;
  order: 1;
}

.volume-icon {
  font-size: 16px;
  color: #16c4e3;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s;
}

.volume-icon:hover {
  color: #FE4980;
}

.volume-slider {
  width: 0;
  opacity: 0;
  transition: all 0.3s ease;
  overflow: hidden;
  position: absolute;
  right: 100%;
  margin-right: 4px;
}

.volume-slider.expanded {
  width: 80px;
  opacity: 1;
}

.speed-control {
  order: 2;
  min-width: 70px;
}

select {
  padding: 6px 8px;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .player-container {
    padding: 12px;
  }
  
  .controls {
    gap: 10px;
  }
  
  .controls-row {
    gap: 8px;
  }
  
  .playback-controls {
    gap: 6px;
  }
  
  .controls button {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .time {
    font-size: 11px;
    min-width: 75px;
  }
}

@media (max-width: 480px) {
  .player-container {
    padding: 10px;
  }
  
  .controls {
    gap: 8px;
  }
  
  .controls-row {
    gap: 6px;
  }
  
  .playback-controls {
    gap: 5px;
  }
  
  .controls button {
    padding: 5px 8px;
    font-size: 12px;
  }
  
  .right-controls {
    gap: 6px;
  }
  
  .speed-control {
    min-width: 60px;
  }
  
  select {
    padding: 4px 6px;
    font-size: 11px;
  }
  
  .time {
    font-size: 10px;
    min-width: 70px;
  }
  
  .volume-icon {
    font-size: 14px;
    padding: 4px;
  }
}

@media (max-width: 320px) {
  .player-container {
    padding: 8px;
  }
  
  .controls {
    gap: 6px;
  }
  
  .playback-controls {
    gap: 4px;
  }
  
  .controls button {
    padding: 4px 6px;
    font-size: 11px;
  }
  
  .speed-control {
    min-width: 55px;
  }
  
  select {
    padding: 3px 4px;
    font-size: 10px;
  }
  
  .time {
    font-size: 9px;
    min-width: 65px;
  }
}

/* Ensure no bottom margins that could affect iframe embedding */
.player-container:last-child {
  margin-bottom: 0 !important;
}

.controls:last-child {
  margin-bottom: 0 !important;
}

.controls-row:last-child {
  margin-bottom: 0 !important;
}
