/* =========================================
   QRBox Tokenized fixed.css
   ========================================= */

/* Updated :root tokens with new and corrected values */
:root {
  /* Page */
  --page-background: #222;
  --page-text: #111;
  --page-text-light: #fff;

  /* Header */
  --header-background: #ebebeb;
  --header-text: #000;
  --header-border: #a50364;

  /* Links */
  --link: #000;
  --link-hover: #a50364;
  --link-hover-text: #fff;
  --link-active: #000;
  --link-active-text: #a50364;
  --link-bg: #ebebeb;
  --link-bg-hover: #ddd;
  --link-bg-active: #a50364;

  /* Cards / Surfaces / Feed */
  --card-background: #c5c5c5;
  --card-border: #ddd;
  --card-text: #111;
  --card-shadow: rgba(0,0,0,.4);

  /* Buttons: primary */
  --button-primary-background: #a50364;
  --button-primary-background-hover: #903550;
  --button-primary-text: #fff;
  --button-primary-text-hover: #222;
  --button-primary-border: #903550;
  --button-shadow-color: rgba(0, 123, 255, 0.5);

  /* Buttons: secondary (placeholders, to be defined) */
  --button-secondary-background: #666;
  --button-secondary-background-hover: #555;
  --button-secondary-text: #fff;
  --button-secondary-border: #444;

  /* Buttons: danger */
  --button-danger-background: #f00;
  --button-danger-background-hover: #d00;
  --button-danger-text: #fff;
  --button-danger-border: #ddd;

  /* Buttons: default */
  --button-default-background: #ddd;
  --button-default-background-hover: #ccc;
  --button-default-text: #a50364;
  --button-default-border: #444;

  /* Close buttons */
  --button-close-background: #222;
  --button-close-background-hover: #555;
  --button-close-text: #fff;
  --button-close-border: #ddd;

  /* Badges / counters */
  --badge-background: #fff;
  --badge-text: #666;
  --badge-border: #ddd;

  /* Sliders / Switches / modal */
  --slider-wrapper: rgba(250, 250, 250, 0.4);
  --slider-background: #ccc;
  --slider-background-before: #fff;
  --slider-text: #333;
  --slider-box-shadow: rgba(255, 255, 255, 0.3);
  --slider-box-overlay: linear-gradient(180deg,rgba(0,0,0,0) 0%,rgba(0,0,0,.55) 60%,rgba(0,0,0,.85) 100%);

  /* Inputs */
  --input-background: #0f0;
  --input-text: #000;
  --input-checked: #a50364;
  --input-checked-text: #fff;
  --input-unchecked: #222;
  --input-unchecked-text: #a50364;
  --input-box-shadow: rgba(92,184,92,.25);
  --input-border: #ddd;
  --input-placeholder: #fff;
  --input-focus-ring: rgb(90 163 255 / .5);

  /* Playlist (light theme) */
  --playlist-background: #ffffff;
  --playlist-title: #101323;
  --playlist-hover: #e5e0e0;
  --playlist-playing: #ede9e9;
  --playlist-border: #d9dce6;
  --playlist-text: #101323;
  --playlist-item-secondary: #aaa; /* Added for .hap-playlist-item-content */
  --playlist-description: #555; /* Added for .hap-playlist-description */
  --playlist-duration: #ccc; /* Added for .hap-playlist-duration */
  --playlist-date: #787878; /* Added for .hap-playlist-date */
  --playlist-icon-inactive: #666; /* Added for .hap-playlist-icon */
  --playlist-icon-active: #fff; /* Added for hover states */

  /* Player */
  --player-background: #27363b; /* Updated to match non-tokenized */
  --player-text: #fff; /* Updated to match non-tokenized */
  --player-buttons: #a50364; /* Matches #9f0360 closely */
  --player-buttons-text: #eee; /* Matches non-tokenized */
  --player-open-buttons-text: #fff;
  --player-buttons-hover: #903550; /* Darker shade for hover */
  --player-border: #444; /* Matches non-tokenized */
  --player-progress-bar: #a50364; /* Matches #9f0360 */
  --player-progress-bar-loading: #ccc; /* Matches non-tokenized */
  --player-ad-timer-bg: #e91e63; /* Added for .hap-media-time-ad */
  --player-ad-progress: #ffeb3b; /* Added for .hap-ad-progress-level */

  /* Status */
  --success: #00ff00;
  --warning: #B76800;
  --danger: #f00;
  --info: #0000ff;
  --typing: #f00;

  /* Gradient */
  --gradient-1: linear-gradient(to top, rgba(0,0,0,.25), rgba(0,0,0,.05));
}

/* Dark theme overrides */
[data-theme="dark"] {
  --page-background: #121212;
  --page-text: #f0f0f0;
  --page-text-light: #cccccc;
  --header-background: #1e1e1e;
  --header-text: #f0f0f0;
  --playlist-background: #27363b; /* Matches non-tokenized player */
  --playlist-title: #fff;
  --playlist-text: #fff;
  --playlist-item-secondary: #aaa;
  --playlist-description: #ccc;
  --playlist-duration: #ccc;
  --playlist-date: #787878;
  --playlist-icon-inactive: #666;
  --playlist-icon-active: #fff;
  --player-background: #27363b;
  --player-text: #fff;
  --player-buttons: #a50364;
  --player-buttons-text: #eee;
  --player-buttons-hover: #903550;
  --player-border: #444;
  --player-progress-bar: #a50364;
  --player-progress-bar-loading: #ccc;
  --player-ad-timer-bg: #e91e63;
  --player-ad-progress: #ffeb3b;
}

/* Player and Playlist Styles */
.hap-fixed {
  position: fixed;
  width: 100%;
  max-width: none;
  bottom: -500px;
  left: 0;
  line-height: normal !important;
  z-index: 999999;
  display: none;
  margin: 0;
  transition: bottom 0.5s ease-out;
  max-width: none !important;
}

.hap-fixed .hap-player-outer {
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
}

.hap-fixed .hap-player-holder {
  position: relative;
  left: 0;
  background: var(--player-background);
  width: 100%;
  float: left;
  max-height: 60px;
}

.hap-fixed .hap-btn {
  display: none;
  height: 100%;
}

.hap-fixed .hap-contr-btn svg {
  color: var(--player-buttons-text);
}

@media (hover: hover) {
  .hap-fixed .hap-btn:hover svg,
  .hap-fixed .hap-contr-btn:hover > svg,
  .hap-fixed .hap-contr-btn-hover svg {
    color: var(--player-buttons-hover);
  }
}

.hap-fixed .hap-contr-btn svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 15px;
  fill: currentColor;
  transition: color .3s ease-out;
}

.hap-fixed .hap-range-toggle svg {
  height: 19px;
}

.hap-fixed .hap-volume-toggle svg {
  height: 20px;
}

.hap-fixed .hap-playback-toggle-ex {
  position: absolute;
  width: 30px;
  height: 30px;
  top: -34px;
  right: 35px;
  background-color: var(--player-background);
  border-top: 1px solid var(--player-border);
  border-left: 1px solid var(--player-border);
  border-right: 1px solid var(--player-border);
  cursor: pointer;
  z-index: 2;
  display: none;
}

.hap-fixed .hap-player-toggle-ex {
  position: absolute;
  width: 30px;
  height: 30px;
  top: -34px;
  right: 0px;
  background-color: var(--player-background);
  border-top: 1px solid var(--player-border);
  border-left: 1px solid var(--player-border);
  border-right: 1px solid var(--player-border);
  cursor: pointer;
  z-index: 2;
}

.hap-fixed .hap-btn-player-toggle {
  transition: transform 0.3s ease-out;
  height: 100%;
  display: block;
}

.hap-fixed .hap-btn-player-toggle svg {
  height: 18px;
}

.hap-fixed .hap-btn-player-toggle-rotate {
  transform: rotate(180deg);
}

.hap-fixed .hap-right-controls {
  position: relative;
  float: right;
  height: 25px;
  top: 17px;
  display: flex;
  margin-right: 15px;
}

.hap-fixed .hap-right-controls .hap-contr-btn {
  float: left;
  margin-left: 10px;
  width: 25px;
  position: relative;
}

.hap-fixed .hap-playlist-bar-controls-right {
  position: relative;
  float: right;
  height: 100%;
  display: flex;
  margin-right: 15px;
}

.hap-fixed .hap-playlist-bar-controls-right .hap-contr-btn {
  float: left;
  margin-left: 10px;
  height: 100%;
  min-width: 25px;
  position: relative;
}

.hap-fixed .hap-left-controls {
  position: relative;
}

.hap-fixed .hap-player-thumb {
  position: relative;
  width: 60px;
  height: 60px;
  float: left;
  overflow: hidden;
  background-position: 50% 50%;
  background-size: cover;
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
}

.hap-fixed .hap-info {
  width: calc(50% - 135px);
  float: left;
  height: 60px;
  margin-left: 10px;
  flex-direction: column;
  overflow: hidden;
  justify-content: center;
  display: flex;
}

.hap-fixed .hap-player-title {
  font-size: 15px;
  color: var(--player-text);
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hap-fixed .hap-player-artist {
  font-size: 13px;
  color: var(--player-text);
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hap-fixed .hap-center-controls {
  position: absolute;
  display: inline-block;
  height: 30px;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
}

.hap-fixed .hap-prev-toggle {
  position: relative;
  left: 0px;
  top: 2px;
  width: 25px;
  height: 25px;
  float: left;
  margin-right: 20px;
}

.hap-fixed .hap-playback-toggle {
  position: relative;
  top: 0px;
  width: 30px;
  height: 30px;
  float: left;
  margin-right: 20px;
}

.hap-fixed .hap-playback-toggle svg {
  height: 25px;
}

.hap-fixed .hap-next-toggle {
  position: relative;
  top: 2px;
  width: 25px;
  height: 25px;
  float: left;
}

.hap-fixed .hap-volume-toggle {
  position: relative;
  width: 25px;
  height: 25px;
  float: right;
  cursor: pointer;
}

.hap-fixed .hap-volume-seekbar {
  position: relative;
  left: 0px;
  top: 5px;
  width: 100px;
  height: 16px;
  float: right;
  cursor: pointer;
  touch-action: none;
}

.hap-fixed .hap-volume-bg {
  position: absolute;
  top: 6px;
  left: 10px;
  width: 80px;
  height: 3px;
  background: var(--player-progress-bar-loading);
}

.hap-fixed .hap-volume-level {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--player-progress-bar);
  transition: all 0.3s ease-in-out;
}

.hap-fixed .hap-seekbar {
  position: absolute;
  top: -14px;
  left: 0px;
  width: 100%;
  height: 20px;
  cursor: pointer;
  touch-action: none;
  z-index: 1;
}

.hap-fixed .hap-progress-bg {
  position: relative;
  background: var(--player-progress-bar-loading);
  width: 100%;
  top: 11px;
  height: 3px;
}

.hap-fixed .hap-load-level {
  position: absolute;
  background: var(--player-progress-bar-loading);
  top: 0;
  height: 100%;
}

.hap-fixed .hap-progress-level {
  position: absolute;
  background: var(--player-progress-bar);
  top: 0;
  height: 100%;
}

.hap-fixed .hap-ad-progress-level {
  background: var(--player-ad-progress);
}

.hap-fixed .hap-media-time-ad {
  position: absolute;
  background: var(--player-ad-timer-bg);
  color: var(--player-text);
  bottom: 9px;
  padding: 3px;
  left: 0;
  font-size: 13px;
  display: none;
}

#hap-playlist-list {
  display: none;
}

.hap-fixed .hap-playlist-holder {
  position: relative;
  width: 100%;
  background: var(--playlist-background);
  overflow: hidden;
  height: 280px;
  border-top: 2px solid var(--player-border);
}

.hap-fixed .hap-playlist-inner {
  margin: 20px 20px 10px 20px;
  max-height: 210px;
  position: relative;
  height: 100%;
}

.hap-fixed .hap-playlist-item {
  font-size: 15px;
  padding: 4px;
  margin-bottom: 5px;
  transition: background-color 0.3s ease-out;
}

.hap-fixed .hap-playlist-item:last-child {
  margin-bottom: 0;
}

.hap-fixed .hap-playlist-item-content {
  color: var(--playlist-item-secondary);
}

.hap-fixed .hap-playlist-thumb {
  height: 40px;
  width: 40px;
  border: 1px solid var(--playlist-item-secondary);
  margin-right: 10px;
}

.hap-fixed .hap-thumbimg {
  -webkit-backface-visibility: hidden;
  filter: grayscale(100%);
}

@media (hover: hover) {
  .hap-fixed .hap-playlist-item:hover .hap-playlist-thumb img {
    filter: grayscale(0%);
  }
}

.hap-fixed .hap-playlist-item-selected {
  background: var(--playlist-playing);
}

.hap-fixed .hap-playlist-item-selected .hap-playlist-title-wrap {
  color: var(--player-text);
}

.hap-fixed .hap-playlist-description {
  font-size: 13px;
  color: var(--playlist-description);
}

.hap-fixed .hap-playlist-duration {
  font-size: 12px;
  color: var(--playlist-duration);
}

.hap-fixed .hap-playlist-date {
  font-size: 11px;
  color: var(--playlist-date);
}

.hap-fixed .hap-playlist-icons {
  margin-right: 20px;
}

.hap-fixed .hap-playlist-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 16px;
  fill: currentColor;
  transition: color .1s ease-out;
}

.hap-fixed .hap-playlist-icon svg {
  color: var(--playlist-icon-inactive);
}

@media (hover: hover) {
  .hap-fixed .hap-playlist-icon:hover svg {
    color: var(--playlist-icon-active);
  }
}

.hap-fixed .hap-playlist-filter-msg span {
  color: var(--player-text);
}

.hap-fixed .hap-playlist-bar {
  position: relative;
  top: 0px;
  clear: both;
  height: 40px;
  width: 100%;
  overflow: hidden;
}

.hap-fixed .hap-search-filter {
  position: relative;
  width: 125px !important;
  height: 18px !important;
  top: 50%;
  margin: -9px 0 0 20px !important;
  padding: 0 2px !important;
  border: 0 !important;
  -moz-border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
  border-radius: 0 !important;
  background: var(--playlist-background) !important;
  color: var(--playlist-title) !important;
  box-shadow: none !important;
  line-height: 1 !important;
  float: left;
  outline: none;
}

.hap-fixed .hap-sort-alpha {
  position: relative;
  left: 5px;
  top: 0px;
  width: 25px;
  height: 100%;
  text-align: center;
  float: left;
}

.hap-fixed .hap-sort-alpha svg {
  height: 17px;
}

/* Dialog */
.hap-fixed .hap-dialog-header {
  background: var(--player-background);
}

/* Range */
.hap-fixed .hap-range-bg {
  top: 14px;
  height: 3px;
  background: var(--player-progress-bar-loading);
}

.hap-fixed .hap-range-handle-a-hit {
  border-bottom-color: var(--player-progress-bar-loading);
}

@media (hover: hover) {
  .hap-fixed .hap-range-handle-a-hit:hover {
    border-bottom-color: var(--player-progress-bar);
  }
}

.hap-fixed .hap-range-handle-b-hit {
  border-top-color: var(--player-progress-bar-loading);
}

@media (hover: hover) {
  .hap-fixed .hap-range-handle-b-hit:hover {
    border-top-color: var(--player-progress-bar);
  }
}

.hap-fixed .hap-range-min-time,
.hap-fixed .hap-range-max-time {
  color: var(--playlist-item-secondary);
}

.hap-fixed .hap-range-level {
  background: var(--player-progress-bar);
}

/* Playback rate */
.hap-fixed .hap-playback-rate-min,
.hap-fixed .hap-playback-rate-max {
  color: var(--playlist-item-secondary);
}

.hap-fixed .hap-playback-rate-bg {
  height: 3px;
  top: 13px;
  background: var(--player-progress-bar-loading);
}

.hap-fixed .hap-range-holder,
.hap-fixed .hap-playback-rate-holder,
.hap-fixed .hap-embed-holder,
.hap-fixed .hap-pwd-holder,
.hap-fixed .hap-seekbar-comment-input-wrap,
.hap-fixed .hap-share-holder {
  background: var(--player-background);
  border: 1px solid var(--player-border);
  box-shadow: 1px 1px 6px rgba(40,40,40,0.3);
}

/* Redirect */
.hap-fixed .hap-redirect-login-holder-inner {
  background: var(--player-background);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.hap-fixed .hap-redirect-login-btn {
  background: var(--player-buttons);
  color: var(--player-open-buttons-text);
}

.hap-fixed .hap-redirect-login-header {
  color: var(--player-open-buttons-text);
}

.hap-fixed .hap-redirect-login-title {
  color: var(--player-text);
}

/* Password */
.hap-fixed .hap-pwd-title {
  color: var(--playlist-icon-inactive);
}

.hap-fixed .hap-pwd-close svg {
  color: var(--playlist-icon-inactive);
}

/* Embed */
.hap-fixed .hap-embed-field-wrap-selected {
  background: var(--playlist-playing);
  color: var(--player-text);
}

/* Playback rate */
.hap-fixed .hap-playback-rate-level,
.hap-fixed .hap-playback-rate-drag {
  background: var(--player-buttons);
}

.hap-fixed .hap-tooltip {
  background: var(--player-buttons);
  color: var(--player-open-buttons-text);
}

.hap-fixed .hap-preloader {
  background-color: var(--player-buttons);
}

/* Lyrics popup */
.hap-fixed .hap-dialog-content {
  background-color: var(--playlist-playing);
}

/* Stats */
.hap-fixed .hap-stat-icon {
  transition: color 0.3s ease-out;
  color: var(--playlist-icon-inactive);
}

@media (hover: hover) {
  .hap-fixed .hap-stat-icon:hover {
    color: var(--playlist-icon-active);
  }
}

.hap-fixed .hap-playlist-item-selected .hap-playlist-duration {
  color: var(--playlist-item-secondary);
}

/* Playback rate toggle */
.hap-fixed .hap-playback-rate-toggle-inner {
  color: var(--player-open-buttons-text);
  background: var(--player-buttons);
}

/* Comments */
.hap-fixed.hap-has-comments .hap-player-holder {
  max-height: 87px;
}

.hap-fixed .hap-input-comment-header {
  color: var(--player-buttons-text);
}

.hap-fixed .hap-comment-input-info {
  color: var(--player-text);
}

.hap-fixed .hap-seekbar-comment-wrap {
  margin-top: 7px;
}

/* Breakpoints */
.hap-fixed.hap-breakpoint-650 .hap-info {
  width: calc(100% - 265px);
  position: absolute;
  left: 60px;
}

.hap-fixed.hap-breakpoint-650 .hap-center-controls {
  right: 60px;
  transform: none;
  left: auto;
}

.hap-fixed.hap-breakpoint-650 .hap-right-controls {
  position: absolute;
  right: 0;
}

.hap-fixed.hap-breakpoint-650 .hap-right-controls .hap-volume-seekbar,
.hap-fixed.hap-breakpoint-650 .hap-right-controls .hap-volume-toggle {
  display: none;
}

.hap-fixed.hap-breakpoint-650 .hap-search-filter {
  display: none;
}