/* ============================================================
   Café Lamhey — Premium Audiobook Player Component Stylesheet
   ============================================================ */

.bk-audio-backdrop {
  position: fixed;
  inset: 0;
  background: hsla(24, 50%, 6%, 0.90);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-luxury);
}

.bk-audio-backdrop.bk-audio-open {
  opacity: 1;
  pointer-events: auto;
}

.bk-audio-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 950px;
  height: 80vh;
  min-height: 550px;
  background: hsl(24, 38%, 11%);
  border: 1px solid hsla(28, 35%, 45%, 0.25);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 40px 100px hsla(24, 50%, 3%, 0.9),
    0 0 0 1px hsla(28, 45%, 50%, 0.15),
    inset 0 1px 0 hsla(30, 35%, 90%, 0.05);
  transform: translateY(40px) scale(0.96);
  transition: transform 0.5s var(--ease-luxury);
}

.bk-audio-backdrop.bk-audio-open .bk-audio-modal {
  transform: translateY(0) scale(1);
}

/* Header Section */
.bk-audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: hsl(26, 32%, 15%);
  border-bottom: 1px solid hsla(28, 35%, 45%, 0.15);
  z-index: 10;
}

.bk-audio-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bk-audio-header-icon {
  width: 24px;
  height: 24px;
  color: var(--glow-color);
}

.bk-audio-title-container {
  display: flex;
  flex-direction: column;
}

.bk-audio-subtitle {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: hsla(28, 35%, 65%, 0.7);
  font-family: var(--body-font);
}

.bk-audio-title {
  font-size: 1.15rem;
  font-family: var(--serif-font);
  font-weight: 600;
  color: var(--white-color);
  margin-top: 0.15rem;
  margin-bottom: 0 !important;
}

.bk-audio-header-right {
  display: flex;
  align-items: center;
}

.bk-audio-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid hsla(28, 35%, 50%, 0.2);
  background: hsla(28, 30%, 18%, 0.6);
  color: hsla(30, 35%, 80%, 0.75);
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
}

.bk-audio-close svg {
  width: 16px;
  height: 16px;
}

.bk-audio-close:hover {
  background: hsla(0, 60%, 45%, 0.25);
  border-color: hsla(0, 60%, 55%, 0.35);
  color: hsl(0, 65%, 75%);
  transform: scale(1.05) rotate(90deg);
}

/* Audio Player Body */
.bk-audio-body {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.bk-audio-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  height: 100%;
}

/* Left Panel: Main Player Controls */
.bk-audio-player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: linear-gradient(135deg, hsl(24, 38%, 11%) 0%, hsl(24, 45%, 8%) 100%);
  border-right: 1px solid hsla(28, 35%, 45%, 0.12);
  overflow-y: auto;
}

/* Vinyl Disc & Cover */
.bk-audio-cover-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cover art square */
.bk-audio-cover-wrap {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  z-index: 3;
  background: hsl(24, 30%, 15%);
  border: 2px solid hsla(28, 35%, 50%, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bk-audio-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bk-audio-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: hsla(28, 35%, 65%, 0.4);
}

/* Vinyl disk behind the cover */
.bk-audio-vinyl-disc {
  position: absolute;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle,
      #111 0px,
      #111 2px,
      #181818 3px,
      #222 4px,
      #111 5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 1;
  transition: transform 0.4s ease;
  left: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bk-audio-vinyl-center {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--first-color);
  border: 3px solid #111;
  position: relative;
}

.bk-audio-vinyl-center::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(24, 38%, 11%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Vinyl rotation animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.bk-audio-playing .bk-audio-vinyl-disc {
  animation: spin 6s linear infinite;
}

/* Track Information styling */
.bk-audio-info {
  text-align: center;
  margin-bottom: 1.8rem;
  width: 100%;
}

.bk-audio-chapter-name {
  font-size: 1.1rem;
  color: var(--white-color);
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-family: var(--serif-font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

.bk-audio-author-name {
  font-size: 0.825rem;
  color: hsla(28, 25%, 75%, 0.7);
  font-family: var(--body-font);
}

/* Timeline/Slider */
.bk-audio-timeline-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}

.bk-audio-time {
  font-size: 0.75rem;
  color: hsla(28, 20%, 75%, 0.8);
  font-family: var(--body-font);
  min-width: 35px;
}

.bk-audio-slider-container {
  position: relative;
  flex: 1;
  height: 8px;
  display: flex;
  align-items: center;
  transition: height 0.2s var(--ease-smooth);
}

.bk-audio-slider-container:hover {
  height: 10px;
}

.bk-audio-slider {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: hsla(28, 25%, 35%, 0.15);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

.bk-audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: hsl(28, 85%, 60%);
  border: 3px solid var(--white-color);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 0 0px hsla(28, 85%, 60%, 0);
  cursor: pointer;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.bk-audio-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    0 0 0 8px hsla(28, 85%, 60%, 0.25);
}

.bk-audio-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: hsl(28, 85%, 60%);
  border: 3px solid var(--white-color);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 0 0px hsla(28, 85%, 60%, 0);
  cursor: pointer;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.bk-audio-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    0 0 0 8px hsla(28, 85%, 60%, 0.25);
}

.bk-audio-progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, hsl(28, 65%, 45%) 0%, hsl(28, 85%, 60%) 100%);
  z-index: 1;
  pointer-events: none;
  width: 0%;
  box-shadow: 0 0 10px hsla(28, 85%, 60%, 0.35);
}

/* Control Buttons styling */
.bk-audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.bk-audio-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: hsla(30, 25%, 85%, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-smooth);
  outline: none;
}

.bk-audio-btn svg {
  width: 20px;
  height: 20px;
}

.bk-audio-btn:hover {
  color: var(--glow-color);
  transform: scale(1.08);
}

.bk-audio-btn:active {
  transform: scale(0.95);
}

.bk-audio-btn.bk-audio-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--first-color);
  color: var(--white-color);
  box-shadow: 0 6px 18px rgba(139, 69, 19, 0.4);
  border: 1px solid hsla(28, 45%, 55%, 0.2);
}

.bk-audio-btn.bk-audio-play:hover {
  background: var(--glow-color);
  box-shadow: 0 8px 24px rgba(228, 120, 50, 0.55);
  color: var(--white-color);
}

.bk-audio-btn.bk-audio-play svg {
  width: 24px;
  height: 24px;
}

.bk-audio-btn.bk-audio-play svg.play-icon {
  margin-left: 2px;
}

.bk-audio-btn text {
  font-weight: 100;
  letter-spacing: 2px;
}

/* Secondary controls (Speed, volume) */
.bk-audio-extra-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0.5rem;
  border-top: 1px solid hsla(28, 35%, 45%, 0.1);
  padding-top: 1.5rem;
}

.bk-audio-speed-btn {
  background: hsla(28, 30%, 18%, 0.6);
  border: 1px solid hsla(28, 35%, 50%, 0.2);
  color: hsla(30, 35%, 85%, 0.85);
  font-family: var(--body-font);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.bk-audio-speed-btn:hover {
  background: hsla(28, 45%, 38%, 0.25);
  border-color: var(--glow-color);
  color: var(--white-color);
}

.bk-audio-volume-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bk-audio-volume-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: hsla(30, 25%, 85%, 0.85);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}

.bk-audio-volume-btn svg {
  width: 16px;
  height: 16px;
}

.bk-audio-volume-btn:hover {
  color: var(--glow-color);
}

.bk-audio-volume-slider-wrap {
  position: relative;
  width: 70px;
  height: 4px;
  display: flex;
  align-items: center;
}

.bk-audio-volume-slider {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: hsla(28, 25%, 35%, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  z-index: 2;
  margin: 0;
}

.bk-audio-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white-color);
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.bk-audio-volume-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--glow-color);
  z-index: 1;
  pointer-events: none;
  width: 80%;
}

/* Right Panel: Chapters List Panel */
.bk-audio-list-panel {
  display: flex;
  flex-direction: column;
  background: hsl(24, 45%, 8%);
  padding: 2rem;
  height: 100%;
  overflow-y: hidden;
}

.bk-audio-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid hsla(28, 35%, 45%, 0.1);
  padding-bottom: 0.8rem;
}

.bk-audio-list-title {
  font-size: 1rem;
  font-family: var(--serif-font);
  color: var(--white-color);
  font-weight: 600;
  margin: 0;
}

.bk-audio-list-count {
  font-size: 0.75rem;
  color: hsla(28, 25%, 65%, 0.6);
  font-family: var(--body-font);
}

.bk-audio-chapters {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.bk-audio-chapters::-webkit-scrollbar {
  width: 5px;
}

.bk-audio-chapters::-webkit-scrollbar-track {
  background: hsla(28, 25%, 35%, 0.05);
}

.bk-audio-chapters::-webkit-scrollbar-thumb {
  background: hsla(28, 25%, 35%, 0.25);
  border-radius: 10px;
}

.bk-audio-chapters::-webkit-scrollbar-thumb:hover {
  background: var(--first-color);
}

/* Chapter Item styling */
.bk-chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: hsla(28, 20%, 15%, 0.3);
  cursor: pointer;
  transition: all 0.25s ease;
}

.bk-chapter-item:hover {
  background: hsla(28, 30%, 18%, 0.6);
  border-color: hsla(28, 35%, 50%, 0.15);
  transform: translateX(4px);
}

.bk-chapter-item.bk-chapter-active {
  background: hsla(28, 45%, 38%, 0.18);
  border-color: hsla(28, 45%, 45%, 0.35);
}

.bk-chapter-item-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
}

/* Active sound animation bars */
.bk-chapter-indicator {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  width: 14px;
  height: 14px;
  justify-content: center;
}

.bk-chapter-play-icon {
  font-size: 0.75rem;
  color: hsla(30, 20%, 75%, 0.5);
  transition: color 0.25s ease;
}

.bk-chapter-item:hover .bk-chapter-play-icon {
  color: var(--glow-color);
}

.bk-chapter-soundbar {
  width: 2.5px;
  height: 100%;
  background-color: var(--glow-color);
  border-radius: 1px;
  transform-origin: bottom;
  transform: scaleY(0.15);
}

.bk-chapter-active.bk-chapter-playing .bk-chapter-soundbar {
  animation: soundBarWave 1.2s ease-in-out infinite alternate;
}

.bk-chapter-active.bk-chapter-playing .bk-chapter-soundbar:nth-child(1) {
  animation-delay: 0.1s;
}

.bk-chapter-active.bk-chapter-playing .bk-chapter-soundbar:nth-child(2) {
  animation-delay: 0.4s;
}

.bk-chapter-active.bk-chapter-playing .bk-chapter-soundbar:nth-child(3) {
  animation-delay: 0.25s;
}

@keyframes soundBarWave {
  0% {
    transform: scaleY(0.15);
  }

  100% {
    transform: scaleY(1);
  }
}

.bk-chapter-text-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bk-chapter-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: hsla(30, 30%, 90%, 0.95);
  font-family: var(--body-font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.bk-chapter-item:hover .bk-chapter-item-title,
.bk-chapter-active .bk-chapter-item-title {
  color: var(--white-color);
}

.bk-chapter-item-number {
  font-size: 0.675rem;
  color: hsla(28, 20%, 65%, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.bk-chapter-item.bk-chapter-active .bk-chapter-item-number {
  color: hsla(28, 50%, 65%, 0.85);
}

.bk-chapter-item-duration {
  font-size: 0.75rem;
  color: hsla(28, 20%, 65%, 0.6);
  font-family: var(--body-font);
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.bk-chapter-active .bk-chapter-item-duration {
  color: var(--glow-color);
}

/* ============================================================
   RESPONSIVE DESIGN (Media Queries)
   ============================================================ */
@media (max-width: 768px) {
  .bk-audio-backdrop {
    padding: 0.5rem;
  }

  .bk-audio-modal {
    height: 95vh;
    border-radius: 12px;
  }

  .bk-audio-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1.2fr 0.8fr;
  }

  .bk-audio-player-panel {
    padding: 1.5rem;
    border-right: none;
    border-bottom: 1px solid hsla(28, 35%, 45%, 0.12);
  }

  .bk-audio-cover-container {
    width: 140px;
    height: 140px;
    margin-bottom: 1rem;
  }

  .bk-audio-cover-wrap {
    width: 110px;
    height: 110px;
  }

  .bk-audio-vinyl-disc {
    width: 130px;
    height: 130px;
    left: 15px;
  }

  .bk-audio-vinyl-center {
    width: 32px;
    height: 32px;
  }

  .bk-audio-info {
    margin-bottom: 1rem;
  }

  .bk-audio-chapter-name {
    font-size: 0.95rem;
  }

  .bk-audio-controls {
    margin-bottom: 1rem;
    gap: 0.8rem;
  }

  .bk-audio-btn.bk-audio-play {
    width: 48px;
    height: 48px;
  }

  .bk-audio-btn.bk-audio-play svg {
    width: 20px;
    height: 20px;
  }

  .bk-audio-extra-controls {
    padding-top: 1rem;
  }

  .bk-audio-list-panel {
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  .bk-audio-backdrop {
    padding: 0.4rem;
  }

  .bk-audio-modal {
    min-height: 480px;
    height: 96vh;
    border-radius: 12px;
  }

  .bk-audio-header {
    padding: 0.75rem 1rem;
  }

  .bk-audio-title-container {
    max-width: 55vw;
  }

  .bk-audio-title {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bk-audio-subtitle {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .bk-audio-player-panel {
    padding: 1rem 1.2rem;
  }

  .bk-audio-cover-container {
    width: 120px;
    height: 120px;
    margin-bottom: 0.75rem;
  }

  .bk-audio-cover-wrap {
    width: 90px;
    height: 90px;
  }

  .bk-audio-vinyl-disc {
    width: 110px;
    height: 110px;
    left: 10px;
  }

  .bk-audio-vinyl-center {
    width: 26px;
    height: 26px;
  }

  .bk-audio-info {
    margin-bottom: 0.75rem;
  }

  .bk-audio-chapter-name {
    font-size: 0.85rem;
    padding: 0 0.5rem;
  }

  .bk-audio-author-name {
    font-size: 0.75rem;
  }

  .bk-audio-timeline-wrap {
    gap: 0.6rem;
    margin-bottom: 0.75rem;
  }

  .bk-audio-time {
    font-size: 0.7rem;
    min-width: 30px;
  }

  .bk-audio-controls {
    margin-bottom: 0.75rem;
    gap: 0.7rem;
  }

  .bk-audio-btn svg {
    width: 16px;
    height: 16px;
  }

  .bk-audio-btn.bk-audio-play {
    width: 42px;
    height: 42px;
  }

  .bk-audio-btn.bk-audio-play svg {
    width: 18px;
    height: 18px;
  }

  .bk-audio-extra-controls {
    padding-top: 0.75rem;
  }

  .bk-audio-speed-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    border-radius: 6px;
  }

  .bk-audio-volume-slider-wrap {
    width: 60px;
  }

  .bk-audio-list-panel {
    padding: 1rem;
  }

  .bk-audio-list-header {
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
  }

  .bk-audio-list-title {
    font-size: 0.9rem;
  }

  .bk-audio-list-count {
    font-size: 0.7rem;
  }

  .bk-chapter-item {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.4rem;
    border-radius: 8px;
  }

  .bk-chapter-item-title {
    font-size: 0.8rem;
  }

  .bk-chapter-item-number {
    font-size: 0.625rem;
  }

  .bk-chapter-item-duration {
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .bk-audio-controls {
    gap: 0.5rem;
  }
}


/* Locked Audiobook Chapters */
.bk-chapter-item.bk-chapter-locked {
  opacity: 0.55;
  background: hsla(28, 12%, 12%, 0.15);
  border: 1px dashed hsla(28, 20%, 45%, 0.15);
  cursor: not-allowed !important;
}

.bk-chapter-item.bk-chapter-locked:hover {
  background: hsla(28, 15%, 15%, 0.25);
  border-color: hsla(0, 45%, 50%, 0.18);
  transform: none;
}

.bk-chapter-lock-icon {
  font-size: 0.8rem;
  color: hsla(28, 35%, 65%, 0.5);
  transition: color 0.25s ease;
}

.bk-chapter-item.bk-chapter-locked:hover .bk-chapter-lock-icon {
  color: hsl(28, 45%, 60%);
}

.bk-chapter-item.bk-chapter-locked .bk-chapter-item-title {
  color: hsla(30, 10%, 75%, 0.5);
}

.bk-chapter-item.bk-chapter-locked .bk-chapter-item-number {
  color: hsla(28, 10%, 55%, 0.35);
}

/* Chapter List Status Messages */
.bk-chapter-loading,
.bk-chapter-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: hsla(28, 20%, 75%, 0.7);
  font-family: var(--body-font);
  font-size: 0.9rem;
  gap: 0.75rem;
  width: 100%;
}

.bk-chapter-loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid hsla(28, 45%, 60%, 0.2);
  border-top-color: hsl(28, 45%, 60%);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.bk-chapter-error {
  color: hsl(0, 75%, 75%);
}