/**
 * Zencloud Player Controls CSS
 * Comprehensive styling for Zencloud player interface
 */

.zencloud-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 10px 15px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zencloud-controls:hover {
  opacity: 1;
}

.zencloud-progress {
  margin-bottom: 10px;
  position: relative;
}

.zencloud-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.zencloud-progress-filled {
  height: 100%;
  background: #ff6b6b;
  border-radius: 3px;
  transition: width 0.1s ease;
  position: relative;
}

.zencloud-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: width 0.1s ease;
}

.zencloud-progress-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.zencloud-progress-bar:hover .zencloud-progress-handle {
  opacity: 1;
}

.zencloud-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.zencloud-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zencloud-controls-left,
.zencloud-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zencloud-controls-center {
  display: flex;
  align-items: center;
  gap: 15px;
}

.zencloud-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.zencloud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.zencloud-btn i {
  font-size: 16px;
}

.zencloud-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zencloud-volume-slider {
  width: 80px;
}

.zencloud-volume-range {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.zencloud-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  border-radius: 50%;
  cursor: pointer;
}

.zencloud-volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.zencloud-speed {
  position: relative;
}

.zencloud-speed-btn {
  min-width: 40px;
  font-size: 12px;
  font-weight: 500;
}

.zencloud-speed-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  padding: 5px 0;
  margin-bottom: 5px;
  min-width: 80px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zencloud-speed-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 12px;
}

.zencloud-speed-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.zencloud-speed-option[data-active="true"] {
  background: #ff6b6b;
  color: white;
}

.zencloud-settings-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 5px;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.zencloud-setting {
  margin-bottom: 10px;
}

.zencloud-setting:last-child {
  margin-bottom: 0;
}

.zencloud-setting label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.zencloud-setting input[type="checkbox"] {
  margin-right: 8px;
  accent-color: #ff6b6b;
}

.zencloud-skip-intro,
.zencloud-skip-outro {
  background: #ff6b6b !important;
  color: white !important;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 15px;
  animation: pulse 2s infinite;
}

.zencloud-skip-intro:hover,
.zencloud-skip-outro:hover {
  background: #ff5252 !important;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .zencloud-controls {
    padding: 8px 10px;
    font-size: 12px;
  }

  .zencloud-controls-center {
    gap: 10px;
  }

  .zencloud-volume-slider {
    width: 60px;
  }

  .zencloud-settings-panel {
    min-width: 180px;
    right: -10px;
  }
}

@media (max-width: 480px) {
  .zencloud-controls-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .zencloud-controls-center {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .zencloud-volume-slider {
    width: 50px;
  }
}

/* Hide controls when not hovering (except on mobile) */
@media (min-width: 769px) {
  .zencloud-controls {
    opacity: 0;
  }

  #player:hover .zencloud-controls {
    opacity: 1;
  }
}

/* Show controls on mobile */
@media (max-width: 768px) {
  .zencloud-controls {
    opacity: 1;
  }
}

/* Fullscreen adjustments */
.fullscreen .zencloud-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

/* Loading state */
.zencloud-loading {
  pointer-events: none;
  opacity: 0.6;
}

.zencloud-loading .zencloud-btn {
  cursor: not-allowed;
}

/* Error state */
.zencloud-error {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
}

/* Accessibility */
.zencloud-btn:focus {
  outline: 2px solid #ff6b6b;
  outline-offset: 2px;
}

.zencloud-volume-range:focus {
  outline: 2px solid #ff6b6b;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .zencloud-controls {
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid white;
  }

  .zencloud-progress-bar {
    background: rgba(255, 255, 255, 0.5);
  }

  .zencloud-progress-filled {
    background: #ff0000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .zencloud-controls,
  .zencloud-progress-filled,
  .zencloud-progress-buffered,
  .zencloud-progress-handle,
  .zencloud-btn {
    transition: none;
  }

  .zencloud-skip-intro,
  .zencloud-skip-outro {
    animation: none;
  }
}
