/* ============================================
   KELIBATMU V2 - CINEMATIC GLOBAL PLAYER
   Clean Unified Version
   ============================================ */
/* ---------- PLAYER CONTAINER ---------- */
.global-player-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-player);
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition:
    opacity var(--transition-slow) var(--ease-soft),
    transform var(--transition-slow) var(--ease-soft);
}
.global-player-container[data-player-visible="false"] {
  opacity: 0;
  transform: translateY(24px);
}
.global-player-container[data-player-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* ---------- GLOBAL PLAYER ---------- */
.global-player {
  width: min(88vw, 920px);
  margin-bottom: 0.9rem;
  border-radius: 40px;
  background: color-mix(in srgb, var(--theme-surface) 88%, transparent);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--theme-border);
  box-shadow:
    0 10px 32px var(--theme-shadow),
    0 0 24px rgba(160, 255, 170, 0.03);
  transition: all var(--transition-base) var(--ease-standard);
}
/* ---------- ACTIVE PLAYER ---------- */
.global-player[data-player-state="playing"] {
  box-shadow:
    0 0 24px rgba(160, 255, 170, 0.1),
    0 0 52px rgba(160, 255, 170, 0.04),
    0 10px 30px rgba(0, 0, 0, 0.34);
  border-color: rgba(160, 255, 170, 0.08);
}
/* ---------- PLAYER GRID ---------- */
.player-dock {
  display: grid;
  grid-template-columns:
    auto
    minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
  padding: 14px 1.2rem;
  min-height: 96px;
}
/* ---------- ARTWORK ---------- */
.player-info {
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-artwork {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(34, 34, 34, 1) 0%,
    rgba(54, 54, 54, 1) 100%
  );
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.32),
    0 0 18px rgba(160, 255, 170, 0.04);
  transition: transform var(--transition-fast) var(--ease-premium);
}
.player-artwork:hover {
  transform: scale(1.02);
}
.artwork-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artwork-placeholder {
  font-size: 1.2rem;
  opacity: 0.4;
}
/* ---------- MAIN ---------- */
.player-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  min-width: 0;
}
/* ---------- TOP ROW ---------- */
.player-top-row {
  display: grid;
  grid-template-columns:
    auto
    minmax(180px, 1fr)
    auto
    auto
    40px;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
/* ---------- CONTROLS ---------- */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}
.player-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.045);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast) var(--ease-premium);
}
.player-btn:hover:not(:disabled) {
  background: rgba(160, 255, 170, 0.1);
  transform: scale(1.04);
}
.player-btn svg {
  width: 17px;
  height: 17px;
  opacity: 0.88;
}
/* ---------- PLAY BUTTON ---------- */
.play-pause-btn {
  width: 42px;
  height: 42px;
  background: rgba(160, 255, 170, 0.1);
  border: 1px solid rgba(160, 255, 170, 0.12);
  box-shadow: 0 0 16px rgba(160, 255, 170, 0.07);
}
.play-pause-btn svg {
  width: 20px;
  height: 20px;
}
/* ---------- SEEKBAR ---------- */
.player-progress-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
}
.current-time,
.duration {
  font-size: 0.6rem;
  opacity: 0.42;
  min-width: 28px;
  text-align: center;
  font-family: monospace;
}
.progress-bar-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.progress-bar {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: height var(--transition-micro) var(--ease-subtle);
}
.progress-bar:hover {
  height: 4px;
}
.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(160, 255, 170, 0.82) 0%,
    rgba(160, 255, 170, 0.5) 100%
  );
}
/* ---------- BOTTOM ROW ---------- */
.player-bottom-row {
  display: grid;
  grid-template-columns:
    auto
    minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
/* ---------- TRACK ---------- */
.player-track-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  overflow: hidden;
}
.player-track-info::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(160, 255, 170, 0.9);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(160, 255, 170, 0.45);
}
.track-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  letter-spacing: -0.01em;
  opacity: 0.88;
}
.track-artist {
  display: none;
}
/* ---------- VISUALIZER ---------- */
.waveform-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  min-width: 0;
}
.visualizer-canvas {
  display: block;
  width: 100%;
  max-width: 520px;
  height: 25px;
  opacity: 0.58;
  transition: opacity var(--transition-smooth) var(--ease-subtle);
  transform: translateY(1px);
}
.global-player[data-player-state="playing"] .visualizer-canvas {
  opacity: 0.88;
}
/* ---------- VOLUME ---------- */
.player-volume {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-right: 0.3rem;
}
/* ---------- VOLUME BUTTON ---------- */
.volume-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.045);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast) var(--ease-premium);
}
.volume-btn:hover {
  background: rgba(160, 255, 170, 0.1);
}
.volume-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.78;
}
/* ---------- VOLUME SLIDER ---------- */
.volume-slider-wrapper {
  width: 84px;
}
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
  transition: height var(--transition-micro) var(--ease-subtle);
}
.volume-slider:hover {
  height: 4px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(160, 255, 170, 0.85);
  box-shadow: 0 0 8px rgba(160, 255, 170, 0.32);
  cursor: pointer;
}
/* ---------- AUDIO PRESETS ---------- */
.player-audio-preset {
  position: relative;
}
.audio-preset-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--theme-border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-surface) 88%, transparent);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 170ms var(--ease-standard), transform 170ms var(--ease-standard);
}
.audio-preset-toggle:hover,
.audio-preset-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--color-text-primary) 10%, var(--theme-surface));
  transform: scale(1.04);
}
.audio-preset-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.audio-preset-toggle:focus-visible,
.audio-preset-option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-text-primary) 35%, transparent);
  outline-offset: 2px;
}
.audio-preset-menu[hidden] {
  display: none;
}
.audio-preset-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: calc(var(--z-player) + 1);
  width: min(300px, calc(100vw - 24px));
  max-height: min(390px, calc(100vh - 150px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--theme-surface) 94%, transparent);
  box-shadow: 0 16px 42px var(--theme-shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0;
  transform: translateY(5px) scale(0.97);
  transform-origin: right bottom;
  transition: opacity 170ms var(--ease-standard), transform 170ms var(--ease-standard);
}
.audio-preset-menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.audio-preset-option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.65rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
}
.audio-preset-option:hover,
.audio-preset-option:focus-visible,
.audio-preset-option[aria-checked="true"] {
  background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
}
.audio-preset-option[aria-checked="true"] {
  box-shadow: inset 2px 0 color-mix(in srgb, var(--color-text-primary) 55%, transparent);
}
.audio-preset-option svg {
  width: 21px;
  height: 21px;
  justify-self: center;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.audio-preset-option span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.audio-preset-option strong {
  font-size: 0.75rem;
  font-weight: 600;
}
.audio-preset-option small {
  color: var(--color-text-secondary, var(--color-text-primary));
  font-size: 0.63rem;
  opacity: 0.66;
}
/* ---------- FULLSCREEN ---------- */
.fullscreen-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.045);
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast) var(--ease-premium);
}
.fullscreen-toggle-btn:hover {
  background: rgba(160, 255, 170, 0.1);
  transform: scale(1.04);
}
.fullscreen-toggle-btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.82;
}
.player-mobile-options {
  display: none;
}
/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  .global-player {
    width: 96vw;
    border-radius: 34px;
    margin-bottom: 0;
  }
  .player-dock {
    column-gap: 0.75rem;
    padding: 11px 0.9rem;
    min-height: 82px;
  }
  .player-artwork {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
  .player-main {
    gap: 0.45rem;
  }
  .player-top-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 40px;
    position: relative;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
  }
  .player-controls {
    gap: 0.2rem;
  }
  .player-btn {
    width: 26px;
    height: 26px;
  }
  .player-btn svg {
    width: 14px;
    height: 14px;
  }
  .play-pause-btn {
    width: 34px;
    height: 34px;
  }
  .play-pause-btn svg {
    width: 16px;
    height: 16px;
  }
  .player-progress-container {
    gap: 0.4rem;
  }
  .current-time,
  .duration {
    display: none;
  }
  .track-title {
    font-size: 0.7rem;
    max-width: 160px;
  }
  .visualizer-canvas {
    height: 16px;
    max-width: 100%;
    opacity: 0.5;
  }
  .player-volume {
    display: none;
  }
  .player-audio-preset {
    display: contents;
  }
  .audio-preset-toggle {
    display: none;
  }
  .audio-preset-menu {
    right: 0;
    bottom: calc(100% + 8px);
    width: min(300px, calc(100vw - 24px));
    max-height: min(350px, calc(100vh - 170px - env(safe-area-inset-bottom)));
    transform-origin: right bottom;
  }
  .player-top-row > .fullscreen-toggle-btn {
    display: none;
  }
  .player-mobile-options {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
  }
  .player-options-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 50%;
    background: color-mix(in srgb, var(--theme-surface) 88%, transparent);
    color: var(--color-text-primary);
    cursor: pointer;
  }
  .player-options-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }
  .player-options-toggle:focus-visible,
  .player-options-item:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-text-primary) 35%, transparent);
    outline-offset: 2px;
  }
  .player-options-menu[hidden] {
    display: none;
  }
  .player-options-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: calc(var(--z-player) + 1);
    width: min(210px, calc(100vw - 24px));
    padding: 0.4rem;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--theme-surface) 94%, transparent);
    box-shadow: 0 14px 36px var(--theme-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(5px) scale(0.97);
    transform-origin: right bottom;
    transition: opacity 170ms var(--ease-standard), transform 170ms var(--ease-standard);
  }
  .player-options-menu[data-open="true"] {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .player-options-item {
    width: 100%;
    min-height: 44px;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--color-text-primary);
    font: inherit;
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
  }
  .player-options-item:hover,
  .player-options-item:focus-visible {
    background: color-mix(in srgb, var(--color-text-primary) 8%, transparent);
  }
  .player-options-item svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}
/* ---------- SMALL DEVICES ---------- */
@media (max-width: 480px) {
  .player-dock {
    padding: 10px 0.8rem;
    column-gap: 0.7rem;
  }
  .player-artwork {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }
  .player-btn {
    width: 28px;
    height: 28px;
  }
  .play-pause-btn {
    width: 34px;
    height: 34px;
  }
  .track-title {
    max-width: 140px;
    font-size: 0.68rem;
  }
  .visualizer-canvas {
    height: 18px;
  }
  .current-time,
  .duration {
    display: none;
  }
}
/* ---------- AMBIENT ---------- */
.ambient-glow-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-ambient);
  background: radial-gradient(
    ellipse at 50% 25%,
    var(--ambient-primary, rgba(139, 44, 44, 0.06)) 0%,
    var(--ambient-secondary, rgba(100, 35, 35, 0.03)) 40%,
    transparent 75%
  );
  opacity: var(--ambient-intensity, 0.08);
  transition:
    background var(--transition-cinematic) var(--ease-soft),
    opacity var(--transition-cinematic) var(--ease-soft);
}
.main-content,
.footer {
  position: relative;
  z-index: var(--z-cards);
}
@media (prefers-reduced-motion: reduce) {
  .ambient-glow-layer,
  .artwork-image,
  .track-title,
  .visualizer-canvas,
  .global-player-container,
  .progress-fill,
  .player-btn,
  .play-pause-btn {
    transition: none !important;
  }
  .audio-preset-toggle,
  .audio-preset-menu,
  .player-options-menu {
    transition: none !important;
  }
  @media (max-width: 768px) {
    .global-player-container {
        bottom: var(--mobile-nav-height, 0px);
    }
}
}
