/* Sticky homepage footer player — mifa.dinbo.de */

body.has-mifa-footer-player {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767.98px) {
  body.has-mifa-footer-player {
    padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px));
  }
}

.mifa-footer-player {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1040;
  display: none;
  pointer-events: none;
}

.mifa-footer-player__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  float: right;
  margin: 0 6px 8px 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 153, 20, 0.95), rgba(255, 179, 71, 0.9));
  color: #1a1208;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(255, 153, 20, 0.35);
  direction: rtl;
  pointer-events: none;
}

.mifa-footer-player__label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1208;
  box-shadow: 0 0 0 3px rgba(26, 18, 8, 0.15);
}

.mifa-footer-player.is-visible {
  display: block;
  pointer-events: auto;
  animation: mfp-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.mifa-footer-player.is-closing {
  animation: mfp-sink 0.28s ease forwards;
}

@keyframes mfp-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mfp-sink {
  to {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

.mifa-footer-player__shell {
  position: relative;
  clear: both;
  display: grid;
  /* RTL: cover | meta | wave | controls  → visual: controls … cover */
  grid-template-columns: auto minmax(100px, 160px) minmax(0, 1fr) auto;
  grid-template-areas: "cover meta wave controls";
  gap: 12px 14px;
  align-items: center;
  padding: 12px 14px 14px;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 153, 20, 0.2), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(83, 207, 224, 0.1), transparent 50%),
    rgba(14, 14, 18, 0.94);
  border: 1px solid rgba(255, 153, 20, 0.35);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  direction: rtl;
}

.mifa-footer-player__cover-wrap {
  grid-area: cover;
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.mifa-footer-player__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mifa-footer-player__cover-ring {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 153, 20, 0.55);
  pointer-events: none;
}

.mifa-footer-player.is-playing .mifa-footer-player__cover-ring {
  box-shadow:
    inset 0 0 0 2px rgba(255, 153, 20, 0.85),
    0 0 16px rgba(255, 153, 20, 0.45);
}

.mifa-footer-player__meta {
  grid-area: meta;
  min-width: 0;
  text-align: right;
}

.mifa-footer-player__title {
  margin: 0;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mifa-footer-player__artist {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* SoundCloud-like waveform — full width between meta and controls */
.mifa-footer-player__sc {
  grid-area: wave;
  position: relative;
  height: 46px;
  width: 100%;
  min-width: 0;
  align-self: stretch;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  direction: ltr;
  padding: 2px 0;
}

.mifa-footer-player__sc-bars {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 100%;
  direction: ltr;
}

.mifa-footer-player__sc-bars span {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.28);
  height: 30%;
  transition: background 0.08s linear;
  transform-origin: bottom center;
}

/* unplayed stays gray; played = orange */
.mifa-footer-player__sc-bars span.is-played {
  background: #ff9914;
}

/* vertical playhead — moves L→R with progress */
.mifa-footer-player__playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: #ff9914;
  box-shadow: 0 0 8px rgba(255, 153, 20, 0.85);
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
}

.mifa-footer-player__playhead::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #ff9914;
  box-shadow: 0 0 10px rgba(255, 153, 20, 0.9);
}

.mifa-footer-player__controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.mifa-footer-player__btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.mifa-footer-player__btn svg {
  display: block;
  flex-shrink: 0;
}

.mifa-footer-player__btn .is-hidden {
  display: none !important;
}

.mifa-footer-player__btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.mifa-footer-player__btn:active {
  transform: scale(0.95);
}

.mifa-footer-player__btn--play {
  width: 48px;
  height: 48px;
  border: 0;
  background: linear-gradient(145deg, #ffb347 0%, #ff9914 55%, #f07a00 100%);
  color: #1a1208;
  box-shadow: 0 8px 22px rgba(255, 153, 20, 0.45);
}

.mifa-footer-player__btn--play:hover {
  background: linear-gradient(145deg, #ffc266 0%, #ff9914 50%, #ff8a00 100%);
  box-shadow: 0 10px 26px rgba(255, 153, 20, 0.55);
}

.mifa-footer-player__btn--close {
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
}

.mifa-footer-player__btn--close:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.25);
  border-color: rgba(255, 80, 80, 0.35);
}

.mifa-footer-player__times {
  position: absolute;
  left: 16px;
  bottom: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.48);
  direction: ltr;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 2;
}

.mifa-footer-player__times-sep {
  margin: 0 3px;
  opacity: 0.7;
}

@media (max-width: 767.98px) {
  .mifa-footer-player {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .mifa-footer-player__shell {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "cover meta controls"
      "wave wave wave";
    gap: 10px 12px;
    padding: 12px 12px 22px;
  }

  .mifa-footer-player__sc {
    height: 36px;
  }

  .mifa-footer-player__controls {
    gap: 6px;
  }

  .mifa-footer-player__btn {
    width: 36px;
    height: 36px;
  }

  .mifa-footer-player__btn--play {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 420px) {
  .mifa-footer-player__btn--close {
    display: none;
  }
}
