/*
  auvi.css - Audio / Video page styles (auvi.php)
  Single panel layout + player redesign
*/

.av-panel {
  width: 100%;
}

.av-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 0.95em;
  color: var(--muted, #94a3b8);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 8px;
}

.av-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  align-items: start;
}

.av-player,
.av-list {
  background: var(--bg-alt, #0f172a);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 16px;
  box-sizing: border-box;
}

.av-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 240px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.96));
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.av-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.25), rgba(2, 6, 23, 0.7));
}

.av-hero-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

#av-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.av-play-btn {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.6);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.av-play-btn:active {
  transform: scale(0.97);
  border-color: rgba(56, 189, 248, 0.8);
}

.av-play-icon {
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid var(--accent, #38bdf8);
  margin-left: 4px;
}

.av-shell.is-playing .av-play-icon {
  width: 20px;
  height: 20px;
  border: none;
  margin-left: 0;
  background: linear-gradient(to right, var(--accent, #38bdf8) 0 6px, transparent 6px 10px, var(--accent, #38bdf8) 10px 16px);
}

.av-meta {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 3;
  color: var(--text, #e2e8f0);
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}

.av-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.av-artist {
  font-size: 0.9rem;
  color: var(--accent, #38bdf8);
  margin-top: 4px;
}

.av-type {
  margin-top: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}

.av-controls {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.av-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}

#av-seek {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.25);
  accent-color: var(--accent, #38bdf8);
  cursor: pointer;
}

#av-seek::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #38bdf8);
}

.av-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.av-wave {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 26px;
}

.av-wave span {
  width: 4px;
  height: 8px;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  transform-origin: bottom;
  animation: wave 1.1s ease-in-out infinite;
  animation-play-state: paused;
}

.av-shell.is-playing .av-wave span {
  background: var(--accent, #38bdf8);
  animation-play-state: running;
}

.av-wave span:nth-child(2) { animation-delay: 0.1s; }
.av-wave span:nth-child(3) { animation-delay: 0.2s; }
.av-wave span:nth-child(4) { animation-delay: 0.3s; }
.av-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.2); }
}

.av-actions {
  display: flex;
  gap: 8px;
}

.av-skip {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.4);
  color: var(--text, #e2e8f0);
  cursor: pointer;
  font-size: 0.78rem;
}

.av-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  margin-left: auto;
}

.av-volume-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

#av-volume {
  flex: 1;
  appearance: none;
  height: 3px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.25);
  accent-color: var(--accent, #38bdf8);
}

.av-list-head {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text, #e2e8f0);
  margin-bottom: 12px;
}

.av-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.av-item {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text, #e2e8f0);
  cursor: pointer;
  text-align: left;
}

.av-item.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3) inset;
}

.av-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(2, 6, 23, 0.9));
  background-image: var(--thumb);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.av-item-fallback {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.75);
}

.av-item-info {
  min-width: 0;
}

.av-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.av-item-artist {
  font-size: 0.75rem;
  color: var(--muted, #94a3b8);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.av-item-type {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
}

@media (max-width: 980px) {
  .av-shell {
    grid-template-columns: 1fr;
  }

  .av-items {
    max-height: 320px;
  }
}

@media (max-width: 720px) {
  .av-hero {
    min-height: 200px;
  }

  .av-play-btn {
    width: 56px;
    height: 56px;
  }

  .av-item {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .av-item-thumb {
    width: 56px;
    height: 56px;
  }

  .av-volume {
    min-width: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .av-play-btn {
    transition: none;
  }

  .av-wave span {
    animation: none;
  }
}