/*
Copyright (C) 2022-2026 miraficus and contributors
SPDX-License-Identifier: AGPL-3.0-or-later

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Radio station artwork is excluded; see the notice in docs/assets/covers.
*/

.player {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) minmax(140px, 180px);
  grid-template-rows: auto auto;
  gap: 16px 24px;
  padding: 24px;
  border: 1px solid var(--accent-border-color);
  border-radius: var(--main-radius);
  background-color: var(--sec-bg-color);
  background-image: var(--surface-pattern);
  background-size: 12px 12px;
}
.player-artwork { grid-column: 1; grid-row: 1 / span 2; align-self: center; width: 136px; aspect-ratio: 1; border-radius: var(--sec-radius); background: #f6f7f9; overflow: hidden; display: grid; place-items: center; }
.player-artwork img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.player-artwork svg { width: 50%; height: 50%; fill: none; stroke: #406484; stroke-width: 2; stroke-linecap: round; }
.player-heading { grid-column: 2; min-width: 0; align-self: end; }
#player-name { margin: 0; font-size: clamp(1.25rem, 2.4vw, 2rem); line-height: 1.2; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.playback-state { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; color: var(--sec-text-color); font-size: 0.9rem; }
.state-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.playback-state[data-state="playing"] .state-dot { background: #2dcc72; opacity: 1; }
.custom-controls { grid-column: 2; display: flex; align-items: center; gap: 16px; min-width: 0; }
.custom-controls button { flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0; width: 48px; height: 48px; border: 1px solid var(--accent-border-color); border-radius: 50%; background: var(--hover-bg-color); color: var(--main-text-color); cursor: pointer; }
.custom-controls button:hover { border-color: var(--accent-bg-color); }
.custom-controls button:disabled { opacity: 0.45; cursor: default; }
.custom-controls button svg { width: 24px; height: 24px; fill: currentColor; }
#custom-play-btn { width: 64px; height: 64px; border-color: transparent; background: var(--accent-bg-color); color: var(--control-text-color); }
#custom-play-btn svg { width: 30px; height: 30px; }
#volume-slider { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; width: 100%; max-width: 300px; height: 32px; margin: 0; background: transparent; cursor: pointer; accent-color: var(--accent-bg-color); }
#volume-slider::-webkit-slider-runnable-track { height: 6px; border-radius: 10px; background: var(--accent-border-color); }
#volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--sec-bg-color); background: var(--accent-bg-color); }
#volume-slider::-moz-range-track { height: 6px; border-radius: 10px; background: var(--accent-border-color); }
#volume-slider::-moz-range-progress { height: 6px; border-radius: 10px; background: var(--accent-bg-color); }
#volume-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--sec-bg-color); background: var(--accent-bg-color); }
.player-settings { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; justify-content: center; gap: 22px; min-width: 0; padding-left: 24px; border-left: 1px solid var(--accent-border-color); }
.quality-wrapper { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 0.9rem; }
#quality-selector { width: 100%; min-width: 0; }
.autoplay-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-size: 0.9rem; }
#autoplay { -webkit-appearance: none; appearance: none; flex-shrink: 0; position: relative; width: 42px; height: 24px; margin: 0; border: 1px solid var(--accent-border-color); border-radius: 20px; background: var(--hover-bg-color); cursor: pointer; }
#autoplay::before { content: ''; display: block; width: 16px; height: 16px; margin: 3px; border-radius: 50%; background: var(--sec-text-color); transition: transform 0.15s; }
#autoplay:checked { background: var(--accent-bg-color); border-color: var(--accent-bg-color); }
#autoplay:checked::before { transform: translateX(18px); background: var(--control-text-color); }
#player-status { grid-column: 1 / -1; margin: 0; padding-top: 12px; border-top: 1px solid var(--accent-border-color); color: var(--sec-text-color); line-height: 1.5; }
@media (min-width: 690px) and (max-width: 960px) {
  .player { grid-template-columns: 112px minmax(0, 1fr) 140px; gap: 16px; padding: 20px; }
  .player-artwork { width: 112px; }
  .player-settings { padding-left: 16px; }
  .custom-controls { gap: 12px; }
  #custom-play-btn { width: 56px; height: 56px; }
}
@media (max-width: 689px) {
  .player { grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 16px; padding: 16px; }
  .player-artwork { grid-column: 1; grid-row: 1; width: 84px; }
  .player-heading { grid-column: 2; grid-row: 1; align-self: center; }
  #player-name { font-size: clamp(1rem, 4.8vw, 1.5rem); }
  .playback-state { margin-top: 8px; font-size: 0.8rem; }
  .custom-controls { grid-column: 1 / -1; grid-row: 2; gap: 14px; }
  #custom-play-btn { width: 56px; height: 56px; }
  .custom-controls button { width: 44px; height: 44px; }
  .player-settings { grid-column: 1 / -1; grid-row: 3; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--accent-border-color); }
  .quality-wrapper { flex: 1; flex-direction: row; align-items: center; min-width: 140px; }
  #quality-selector { width: auto; flex: 1; }
  .autoplay-wrapper { flex: none; gap: 10px; }
}
