/* Global Mini Player */
.global-mini-player {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: max-content;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 40px;
  padding: 6px 14px 6px 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-mini-player.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .global-mini-player {
  background: rgba(26, 26, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.mini-disc {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  cursor: pointer;
  background: #111;
}

.mini-disc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mini-disc.playing {
  animation: miniSpin 6s linear infinite;
}

@keyframes miniSpin {
  100% { transform: rotate(360deg); }
}

.mini-info {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  max-width: 150px;
}

.mini-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mini-sub {
  font-size: 10px;
  color: var(--accent-clover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.mini-btn {
  background: none;
  border: none;
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  padding: 0;
}

.mini-btn:hover {
  color: var(--accent-clover);
  transform: scale(1.1);
}

.mini-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Mini Close Button (Top-Right, Pops in on pause or hover) */
.mini-close-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, color 0.2s;
  padding: 0;
}

/* When paused or hovered, show the close button smoothly */
.global-mini-player.is-paused .mini-close-btn,
.global-mini-player:hover .mini-close-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.mini-close-btn:hover {
  background: #E85A5A;
  color: #FFF;
  border-color: #E85A5A;
  transform: scale(1.15);
}

[data-theme="dark"] .mini-close-btn {
  background: #2D2D34;
  border-color: rgba(255, 255, 255, 0.18);
  color: #B0B0B8;
}

[data-theme="dark"] .mini-close-btn:hover {
  background: #E85A5A;
  color: #FFF;
  border-color: #E85A5A;
}

/* On Desktop: Float in bottom right */
@media (min-width: 769px) {
  .global-mini-player {
    left: auto;
    right: 28px;
    bottom: 28px;
    transform: translateY(20px);
  }
  .global-mini-player.active {
    transform: translateY(0);
  }
}

/* Page Transition Wrapper */
#pageContent {
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
#pageContent.page-fade-out {
  opacity: 0;
}

/* Elegant Floating Toast */
.eunbin-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 300000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.eunbin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-theme="dark"] .eunbin-toast {
  background: rgba(30, 30, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
