.h5ap_search_template {
  width: 800px;
  max-width: 100%;
  margin: 0 auto;
}
.h5ap_search_template h1 {
  margin: 30px auto;
}
.h5ap_search_template .plyr {
  height: auto;
  margin-bottom: 50px;
}

/* #h5ap_search_form {
  position: relative;
  max-width: 100%;
  margin: 0;
  padding: 0;

  input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
  }

  button {
    position: absolute;
    right: -7%;
    top: 50%;
    border: 0;
    transform: translate(0%, -50%);
    padding: 0;
    height: 100%;
    width: 50px;
    background: transparent;
    line-height: 0;
  }

  svg {
    fill: #333;
    height: 25px;
    width: 25px;
  }
} */

#h5ap_search_form {
  position: relative;
  max-width: 400px;
  width: 100%;

  input {
    width: 100%;
    padding: 15px 50px 15px 16px;
    border: 1px solid #e2e2e2;
    border-radius: 50px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f9fafb;
  }

  input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  }

  button {
    position: absolute;
    right: -13%;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #e2e2e2;
    height: 36px;
    width: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  button:hover {
    background: #e2e2e2;
    transform: translateY(-50%) scale(1.05);
  }

  svg {
    fill: #ffffff;
    height: 16px;
    width: 16px;
  }
}

/* ── Premium Playback Speed Menu (Global for all skins) ── */
.plyr__menu__container {
    --plyr-menu-background: #ffffff !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    min-width: 150px !important;
    z-index: 2147483647 !important; /* Max z-index to stay above headers! */
    bottom: 100% !important;
    margin-bottom: 15px !important;
}

.plyr__menu__container::after {
    border-top-color: #ffffff !important;
}

.plyr__menu__container [role="menu"] {
    padding: 0 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    /* Prevent overflowing the browser window */
    max-height: 240px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Custom Premium Scrollbar */
.plyr__menu__container [role="menu"]::-webkit-scrollbar {
    width: 5px !important;
}

.plyr__menu__container [role="menu"]::-webkit-scrollbar-track {
    background: #f8f9fa !important;
    border-radius: 4px !important;
}

.plyr__menu__container [role="menu"]::-webkit-scrollbar-thumb {
    background: #d1d5db !important;
    border-radius: 4px !important;
}

.plyr__menu__container [role="menu"]::-webkit-scrollbar-thumb:hover {
    background: #9ca3af !important;
}

.plyr__menu__container .plyr__control[role="menuitemradio"] {
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    color: #333 !important;
    background: #ffffff !important;
    transition: background 0.2s, color 0.2s !important;
    margin: 2px 0 !important;
    width: 100% !important;
}

.plyr__menu__container .plyr__control[role="menuitemradio"]:hover {
    background: #eef8ff !important;
    color: #00b2ff !important;
    text-shadow: none !important;
}

/* The Radio Circle */
.plyr__menu__container .plyr__control[role="menuitemradio"]::before {
    background: #ffffff !important;
    border: 2px solid #ccc !important;
    box-shadow: none !important;
    height: 16px !important;
    width: 16px !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    transition: border-color 0.2s !important;
}

/* The Radio Dot (hidden by default) */
.plyr__menu__container .plyr__control[role="menuitemradio"]::after {
    background: #00b2ff !important;
    height: 8px !important;
    width: 8px !important;
    left: 16px !important;
    opacity: 0 !important;
    transform: translateY(-50%) scale(0) !important;
    transition: transform 0.2s, opacity 0.2s !important;
}

/* Active/Checked State */
.plyr__menu__container .plyr__control[role="menuitemradio"][aria-checked="true"] {
    color: #00b2ff !important;
    background: #eef8ff !important;
    font-weight: 600 !important;
}

.plyr__menu__container .plyr__control[role="menuitemradio"][aria-checked="true"]::before {
    border-color: #00b2ff !important;
}

.plyr__menu__container .plyr__control[role="menuitemradio"][aria-checked="true"]::after {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1) !important;
}

/* Back button / Speed Title inside Menu */
.plyr__menu__container .plyr__control--back {
    padding: 8px 12px 8px 28px !important; /* 28px left padding gives space for the back arrow! */
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #111 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #eee !important;
    border-radius: 6px !important;
    position: relative !important;
}

.plyr__menu__container .plyr__control--back::before {
    box-shadow: none !important;
}

.plyr__menu__container .plyr__control--back::after {
    border-right-color: #555 !important; /* Subtle dark gray arrow instead of bright blue */
    left: 10px !important; /* Position arrow nicely to the left */
}

.plyr__menu__container .plyr__control--back:hover {
    background: #f8f8f8 !important;
    text-shadow: none !important;
}

.plyr__menu__container .plyr__control--back:hover::after {
    border-right-color: #111 !important;
}

.plyr__menu__container .plyr__control--forward {
    padding: 8px 12px !important;
    font-weight: 500 !important;
    background: #ffffff !important;
    border-radius: 6px !important;
}

.plyr__menu__container .plyr__control--forward:hover {
    background: #f8f8f8 !important;
    color: #00b2ff !important;
    text-shadow: none !important;
}

.plyr__menu__container .plyr__control--forward::after {
    border-left-color: #00b2ff !important;
}

.plyr__menu__container .plyr__control--forward .plyr__menu__value {
    color: #00b2ff !important;
    font-weight: 600 !important;
}

/* ── Ensure the player container stacking context stays above site headers/menus ── */
.skin_default,
.narrowPlaylist,
.bluePlaylist,
.h5ap_playlist,
.h5ap_player,
.h5ap_standard_player {
    position: relative !important;
    z-index: 999999 !important;
}

