/* /css/audio.css
   Відповідає за: UI сторінок Audio (бібліотека) та Audio App (плеєр + iframe).
*/

.audio-wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.audio-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 14px;
}

.audio-muted { opacity: .7; }

.audio-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 14px;
}
@media (max-width: 992px) {
  .audio-grid { grid-template-columns: 1fr; }
}

.audio-table {
  width: 100%;
  border-collapse: collapse;
}
.audio-table th, .audio-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  vertical-align: middle;
}
.audio-table th {
  font-weight: 700;
  text-align: left;
  background: rgba(0,0,0,.03);
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.audio-btn:hover { background: rgba(0,0,0,.03); }

.audio-btn-primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.audio-btn-primary:hover { filter: brightness(1.07); }

.audio-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
  font-size: 12px;
}

/* ===== PJAX loading state (global_player.js) ===== */
body.pjax-loading #appMain {
  opacity: .55;
  pointer-events: none;
  filter: grayscale(.15);
}
body.pjax-loading {
  cursor: progress;
}

/* ===== Audio App layout ===== */
.audio-app {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0b0b0f;
  color: #fff;
}

.audio-app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.audio-app-main {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 0;
}

.audio-app-sidebar {
  border-right: 1px solid rgba(255,255,255,.10);
  padding: 12px;
  overflow: auto;
}

.audio-app-frame {
  min-height: 0;
  background: #111;
}
.audio-app-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* ===== Player bar ===== */
.audio-playerbar {
  border-top: 1px solid rgba(255,255,255,.10);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 420px 1fr;
  align-items: center;
  gap: 12px;
}

.audio-now {
  overflow: hidden;
}
.audio-now .t1 {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-now .t2 {
  opacity: .75;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.audio-iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.audio-iconbtn:hover { background: rgba(255,255,255,.10); }
.audio-iconbtn.primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* focus styles (keyboard) */
.audio-btn:focus-visible,
.audio-iconbtn:focus-visible,
.audio-item:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}

.audio-progress {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.audio-progress input[type="range"] { width: 100%; }

.audio-right {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}
.audio-right input[type="range"] { width: 140px; }

.audio-list {
  display: grid;
  gap: 8px;
}
.audio-item {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.audio-item:hover { background: rgba(255,255,255,.07); }
.audio-item .n1 { font-weight: 800; }
.audio-item .n2 { opacity: .75; font-size: 13px; }

/* active item highlight (player.js / global_player.js) */
.audio-item.is-active {
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 2px rgba(255,255,255,.14) inset;
}

/* ===== Responsive: Audio App ===== */
@media (max-width: 992px) {
  .audio-app-main {
    grid-template-columns: 1fr;
    grid-template-rows: 300px 1fr;
  }
  .audio-app-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  .audio-playerbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .audio-right {
    justify-content: flex-start;
  }
  .audio-right input[type="range"] {
    width: 180px;
  }
}

@media (max-width: 520px) {
  .audio-progress {
    grid-template-columns: 44px 1fr 44px;
  }
  .audio-iconbtn {
    width: 36px;
    height: 36px;
  }
}