/* =========================================================
   HDS Audio Player
   Mini + Full — CSS variables driven (Elementor ready)
   ========================================================= */

/* ===== Wrapper ===== */
.hdp-el-wrap{
  width: 100%;
}

/* =========================================================
   BASE (mini + full)
   ========================================================= */
.hdp-player{
  display: inline-flex;
  align-items: center;
  gap: 10px;

  width: var(--hdp-width, auto);
  max-width: var(--hdp-max-width, 420px);

  padding: var(--hdp-pad, 10px 12px);
  border-radius: var(--hdp-radius, 10px);
  background: var(--hdp-bg, #f5f5f5);

  box-sizing: border-box; /* loops/grids */
  line-height: 1;         /* avoids unexpected theme inheritance */
}

/* =========================================================
   MINI (row): button + bar
   ========================================================= */
.hdp-player.hdp-mini{
  --hdp-max-width: 420px;

  display: flex;             /* better than inline-flex in loops/mobile */
  width: 100%;
  max-width: 100%;
  align-items: center;
}

.hdp-player.hdp-mini .hdp-main{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.hdp-player.hdp-mini .hdp-bar{
  flex: 1 1 auto;
  min-width: 0;
}

/* =========================================================
   FULL
   ========================================================= */
.hdp-player.hdp-full{
  --hdp-width: 100%;
  --hdp-max-width: none;
  gap: var(--hdp-gap-full, 12px);
}

/* =========================================================
   BUTTON
   ========================================================= */
.hdp-btn{
  width: var(--hdp-btn-size, 36px);
  height: var(--hdp-btn-size, 36px);

  border: 0;
  border-radius: var(--hdp-btn-radius, 10px);

  background: var(--hdp-btn-bg, #111);
  color: var(--hdp-btn-color, #fff);
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;

  padding: 0;            /* themes may inject padding */
  margin: 0;
  min-width: 0;
  text-decoration: none; /* in case themes treat it as a link */

  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  text-shadow: none;
  outline: none;

  line-height: 1;
}

.hdp-btn:hover,
.hdp-btn:focus,
.hdp-btn:active{
  background: var(--hdp-btn-bg-hover, var(--hdp-btn-bg, #111));
  color: var(--hdp-btn-color-hover, var(--hdp-btn-color, #fff));
}

.hdp-icon{
  font-size: 14px;
  line-height: 1;
  color: inherit;
  display: inline-block;
}

/* Inline SVG support */
.hdp-icon svg{
  display: block;
  width: 1em;
  height: 1em;
}

.hdp-icon-pause{ display: none; }
.hdp-player.is-playing .hdp-icon-play{ display: none; }
.hdp-player.is-playing .hdp-icon-pause{ display: inline; }

/* =========================================================
   PROGRESS BAR
   ========================================================= */
.hdp-bar{
  position: relative;
  height: var(--hdp-bar-height, 8px);
  min-height: var(--hdp-bar-height, 8px);
  border-radius: var(--hdp-bar-radius, 999px);
  background: var(--hdp-bar-bg, rgba(0,0,0,.12));
  flex: 1 1 auto;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}

.hdp-bar-fill{
  height: 100%;
  width: 0%;
  background: var(--hdp-bar-fill, rgba(0,0,0,.65));
  display: block;
}

/* =========================================================
   FULL LAYOUT
   ========================================================= */
.hdp-player.hdp-full .hdp-cover{
  width: var(--hdp-cover-size, 86px);
  height: var(--hdp-cover-size, 86px);
  border-radius: var(--hdp-cover-radius, 10px);
  overflow: hidden;
  background: var(--hdp-cover-bg, rgba(0,0,0,.08));
  flex: 0 0 auto;
}

.hdp-player.hdp-full .hdp-cover img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hdp-player.hdp-full .hdp-main{
  display: flex;
  flex-direction: column;
  gap: var(--hdp-main-gap, 10px);
  width: 100%;
  min-width: 0;
}

.hdp-player.hdp-full .hdp-top{
  display: flex;
  align-items: center;
  gap: var(--hdp-top-gap, 12px);
  min-width: 0;
}

.hdp-player.hdp-full .hdp-text{
  min-width: 0;
  flex: 1;
}

.hdp-player.hdp-full .hdp-title{
  font-weight: var(--hdp-title-weight, 700);
  font-size: var(--hdp-title-size, 14px);
  line-height: 1.2;
  color: var(--hdp-title-color, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdp-player.hdp-full .hdp-subtitle{
  margin-top: 2px;
  font-size: var(--hdp-subtitle-size, 12px);
  color: var(--hdp-subtitle-color, rgba(0,0,0,.75));
  opacity: var(--hdp-subtitle-opacity, .75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdp-player.hdp-full .hdp-duration{
  font-size: var(--hdp-duration-size, 12px);
  color: var(--hdp-duration-color, rgba(0,0,0,.7));
  opacity: var(--hdp-duration-opacity, .7);
  flex: 0 0 auto;
}

.hdp-track-list{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hdp-track{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hdp-track-border, rgba(0,0,0,.14));
  border-radius: var(--hdp-track-radius, 999px);
  background: var(--hdp-track-bg, rgba(255,255,255,.45));
  color: var(--hdp-track-color, inherit);
  cursor: pointer;
  font: inherit;
  font-size: var(--hdp-track-size, 12px);
  line-height: 1;
  max-width: 100%;
  padding: 6px 9px;
}

.hdp-track:hover,
.hdp-track:focus,
.hdp-track.is-active{
  background: var(--hdp-track-active-bg, var(--hdp-btn-bg, #111));
  border-color: var(--hdp-track-active-border, var(--hdp-btn-bg, #111));
  color: var(--hdp-track-active-color, var(--hdp-btn-color, #fff));
}

.hdp-track-number{
  align-items: center;
  background: var(--hdp-track-number-bg, rgba(0,0,0,.1));
  border-radius: 999px;
  color: inherit;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  height: 16px;
  justify-content: center;
  min-width: 16px;
}

.hdp-track-label{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Volume control (desktop) ===== */
.hdp-volume{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.hdp-volume-icon{
  font-size: 14px;
  line-height: 1;
  opacity: .75;
}

.hdp-volume input[type="range"]{
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hdp-bar-bg, rgba(0,0,0,.2));
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
}

.hdp-volume input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hdp-bar-fill, #000);
}

/* =========================================================
   MINI: extra hardening for aggressive loop styles
   ========================================================= */
.hdp-player.hdp-mini .hdp-btn{
  -webkit-appearance: none !important;
  appearance: none !important;

  background: var(--hdp-btn-bg, #111) !important;
  background-color: var(--hdp-btn-bg, #111) !important;
  color: var(--hdp-btn-color, #fff) !important;

  border: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  outline: none !important;

  padding: 0 !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: var(--hdp-btn-size, 36px) !important;
  height: var(--hdp-btn-size, 36px) !important;
  border-radius: var(--hdp-btn-radius, 10px) !important;
}

.hdp-player.hdp-mini .hdp-icon{
  color: inherit !important;
  line-height: 1 !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px){

  /* MINI: slightly more breathing room */
  .hdp-player.hdp-mini{
    gap: 12px;
  }

  /* FULL: cover on top and content below */
  .hdp-player.hdp-full{
    flex-direction: column;
    align-items: stretch;
  }

  .hdp-player.hdp-full .hdp-cover{
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--hdp-cover-radius-mobile, 12px);
  }

  /* FULL: hide volume on mobile */
  .hdp-player.hdp-full .hdp-volume{
    display: none !important;
  }

  /* FULL: cleaner mobile layout */
  .hdp-player.hdp-full .hdp-top{
    flex-wrap: wrap;
    gap: var(--hdp-top-gap-mobile, 10px);
    row-gap: 8px;
  }

  .hdp-player.hdp-full .hdp-duration{
    margin-left: auto;
  }

  .hdp-player.hdp-full .hdp-text{
    flex: 0 0 100%;
    order: 3;
  }

  .hdp-player.hdp-full .hdp-title{
    font-size: var(--hdp-title-size-mobile, 14px);
  }

  .hdp-player.hdp-full .hdp-subtitle{
    font-size: var(--hdp-subtitle-size-mobile, 12px);
  }
}
