/* =====================================================
   LE FLEUR AMBIENT MUSIC PLAYER
===================================================== */

.lf-ambient-player {
  position: fixed;
  left: 22px;
  right: auto;
  bottom: 22px;

  z-index: 99999;

  font-family: inherit;
}

.lf-ambient-player[hidden] {
  display: none !important;
}

.lf-ambient-toggle {
  display: flex;
  align-items: center;
  gap: 11px;

  min-width: 190px;
  min-height: 58px;

  margin: 0;
  padding: 8px 18px 8px 9px;

  color: #513d3d;

  background:
    linear-gradient(
      135deg,
      rgba(255, 253, 252, 0.97),
      rgba(250, 234, 232, 0.96)
    );

  border: 1px solid rgba(191, 139, 127, 0.38);
  border-radius: 999px;

  box-shadow:
    0 12px 35px rgba(82, 47, 47, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);

  cursor: pointer;
  outline: none;

  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.lf-ambient-toggle:hover {
  transform: translateY(-2px);

  border-color: rgba(177, 113, 101, 0.62);

  box-shadow:
    0 16px 40px rgba(82, 47, 47, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.lf-ambient-toggle:focus-visible {
  box-shadow:
    0 0 0 4px rgba(197, 139, 128, 0.22),
    0 16px 40px rgba(82, 47, 47, 0.22);
}

.lf-ambient-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;

  width: 42px;
  height: 42px;
  flex: 0 0 42px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #d6a49a,
      #a96f68
    );

  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;

  box-shadow:
    0 6px 16px rgba(145, 84, 79, 0.30);
}

.lf-ambient-icon svg {
  display: block;

  width: 19px;
  height: 19px;

  fill: currentColor;
}

.lf-icon-pause {
  display: none !important;
}

.lf-ambient-information {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  line-height: 1.25;
  text-align: left;
}

.lf-ambient-information strong {
  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.lf-ambient-information small {
  display: block;

  margin-top: 2px;

  color: #8d6c69;

  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}

/* =====================================================
   PLAYING STATE
===================================================== */

.lf-ambient-player.is-playing .lf-icon-music {
  display: none;
}

.lf-ambient-player.is-playing .lf-icon-pause {
  display: block !important;
}

.lf-ambient-player.is-playing .lf-ambient-icon {
  animation:
    lfAmbientPulse
    2.2s
    ease-in-out
    infinite;
}

@keyframes lfAmbientPulse {
  0%,
  100% {
    box-shadow:
      0 6px 16px rgba(145, 84, 79, 0.30),
      0 0 0 0 rgba(190, 126, 116, 0.30);
  }

  50% {
    box-shadow:
      0 6px 16px rgba(145, 84, 79, 0.30),
      0 0 0 10px rgba(190, 126, 116, 0);
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media screen and (max-width: 767px) {
  .lf-ambient-player {
    left: 14px;
    right: auto;
    bottom: 16px;
  }

  .lf-ambient-toggle {
    min-width: auto;
    min-height: 52px;

    padding: 5px;
  }

  .lf-ambient-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .lf-ambient-information {
    display: none;
  }
}

/* รองรับ iPhone ที่มีแถบด้านล่าง */

@supports (
  bottom:
    env(safe-area-inset-bottom)
) {
  @media screen and (max-width: 767px) {
    .lf-ambient-player {
      bottom:
        calc(
          14px +
          env(safe-area-inset-bottom)
        );
    }
  }
}

/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว */

@media (prefers-reduced-motion: reduce) {
  .lf-ambient-toggle,
  .lf-ambient-player.is-playing
  .lf-ambient-icon {
    animation: none;
    transition: none;
  }
}
