/* rutube-player.css */

/* Основной контейнер */
.rutube-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; 
  background: #000;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
  font-family: Arial, sans-serif;
  
  /* Резерв для старых браузеров без aspect-ratio */
  @supports not (aspect-ratio: 16 / 9) {
	height: 0;
	padding-bottom: 56.25%; /* 16:9 */
  }
}

.rutube-player-wrapper:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  cursor: none;
}

.rutube-player-wrapper.show-cursor {
  cursor: default;
}

/* Iframe и контейнеры */
.rutube-player-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

.rp-iframe-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Placeholder (Обложка) */
.rp-placeholder {
  position: absolute;
  inset: 0;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: opacity 0.3s;
}
.rp-placeholder.hidden {
  display: none;
}

/* UI Элементы */
.rp-click-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 100px);
  z-index: 40;
}

.rp-pause-curtain {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity .2s, visibility .2s;
  backdrop-filter: blur(5px);
  pointer-events: auto;
}
.rp-pause-curtain.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Большая кнопка Play */
.rp-big-play-btn {
  width: 90px;
  height: 90px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: rgba(255,0,85,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-left: 8px;
  transition: transform .2s, background .2s;
  cursor: pointer;
  outline: none;
}
.rp-big-play-btn:hover {
  transform: scale(1.1);
  background: rgba(255,0,85,.4);
}
.rp-big-play-icon {
  width: 0;
  height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 32px solid #fff;
}

/* Панель управления */
.rp-controls {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100px;
  z-index: 60;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 15%, rgba(0,0,0,0.7) 30%, rgba(0,0,0,0.95) 50%, rgba(0,0,0,1) 70%, #000 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px 10px 15px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}

/* Логика показа панели */
.rutube-player-wrapper:hover .rp-controls,
.rutube-player-wrapper.show-controls .rp-controls {
  opacity: 1;
  pointer-events: auto;
}

.rutube-player-wrapper:fullscreen:hover .rp-controls { opacity: 0; pointer-events: none; }
.rutube-player-wrapper:fullscreen.show-controls .rp-controls { opacity: 1 !important; pointer-events: auto; }

/* Кнопки управления */
.rp-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding: 0;
  transition: transform 0.2s;
  outline: none !important;
}
.rp-btn:hover { transform: scale(1.15); }
.rp-btn:active { transform: scale(0.95); }
.rp-loop-off { opacity: 0.4; }
.rp-loop-btn { font-size: 28px; margin-bottom: 4px; }
.rp-fs-btn { font-size: 24px; margin-left: 5px; }

/* Ползунок */
.rp-seek-bar {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.rp-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff0055;
  margin-top: -5px;
  box-shadow: 0 0 5px rgba(0,0,0,.5);
  cursor: pointer;
}

/* Таймер */
.rp-time {
  color: #ddd;
  font-size: 13px;
  min-width: 95px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Подсказка */
.rp-tooltip {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.95);
  color: #fff;
  padding: 10px 30px;
  border-radius: 12px;
  font-size: 25px;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(15px);
}
.rp-tooltip.visible { opacity: 1; }

/* Лоадер */
.rp-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #ff0055;
  border-radius: 50%;
  animation: rp-spin 0.8s linear infinite;
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.rp-loader.visible { opacity: 1; }
@keyframes rp-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
