/* ==========================================================================
   AION PRIMUS • PÍLULA FLUTUANTE LIVRE & ARRASTÁVEL (DRAGGABLE AUDIO PILL)
   Design Hermético de Vidro Negro & Ouro com Motor Zero-Overlap
   ========================================================================== */

:root {
  --pill-gold: #d4af37;
  --pill-gold-light: #f6e27a;
  --pill-gold-dark: #8a6414;
  --pill-bg: rgba(6, 10, 18, 0.94);
  --pill-border: rgba(212, 175, 55, 0.55);
  --pill-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(212, 175, 55, 0.22);
}

/* Container Flutuante Arrastável */
.aion-draggable-pill-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: box-shadow 0.25s;
}

.aion-draggable-pill-wrap.is-dragging {
  cursor: grabbing !important;
  opacity: 0.92;
  transform: scale(1.02);
  transition: none !important;
}

/* Cápsula Principal */
.aion-drag-pill {
  display: flex;
  flex-direction: column;
  background: var(--pill-bg);
  border: 1.5px solid var(--pill-border);
  border-radius: 9999px;
  box-shadow: var(--pill-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-radius 0.28s ease, border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
  max-width: 440px;
}

.aion-drag-pill.expanded {
  border-radius: 20px;
}

.aion-drag-pill.playing {
  border-color: var(--pill-gold-light);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9), 0 0 24px rgba(212, 175, 55, 0.4);
}

/* Barra Superior da Pílula (Linha Compacta) */
.aion-pill-main-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  cursor: grab;
}

.aion-draggable-pill-wrap.is-dragging .aion-pill-main-bar {
  cursor: grabbing;
}

/* Alça de Arraste (Grip) */
.aion-pill-grip {
  color: #64748b;
  font-size: 0.75rem;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: color 0.2s;
}

.aion-pill-main-bar:hover .aion-pill-grip {
  color: var(--pill-gold);
}

/* Botão Play / Pause da Pílula */
.aion-pill-btn-play {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f6e27a, #d4af37, #8a6414);
  border: 1px solid #ffffff;
  color: #030508;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.55);
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
}

.aion-pill-btn-play:hover {
  transform: scale(1.1);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.85);
}

.aion-pill-btn-play:active {
  transform: scale(0.95);
}

/* Informações da Faixa / Título */
.aion-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  max-width: 190px;
  overflow: hidden;
  cursor: pointer;
}

.aion-pill-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.aion-pill-meta {
  font-size: 0.65rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.aion-pill-pulse-dot {
  width: 5px;
  height: 5px;
  min-width: 5px;
  border-radius: 50%;
  background: var(--pill-gold);
}

.aion-drag-pill.playing .aion-pill-pulse-dot {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: aionPillPulse 1.5s infinite ease-in-out;
}

@keyframes aionPillPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; }
}

/* Botões da Direita da Pílula */
.aion-pill-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.aion-pill-mini-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.aion-pill-mini-btn:hover {
  color: #ffffff;
  background: rgba(212, 175, 55, 0.2);
  transform: scale(1.1);
}

.aion-pill-mini-btn.active {
  color: var(--pill-gold-light);
}

/* Painel de Expansão (Chips e Volume) */
.aion-pill-drawer {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 4px 14px 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  animation: drawerSlide 0.25s ease forwards;
}

.aion-drag-pill.expanded .aion-pill-drawer {
  display: flex;
}

@keyframes drawerSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chips Seletoras Rápidas */
.aion-pill-chips-row {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.aion-pill-chips-row::-webkit-scrollbar {
  display: none;
}

.aion-pill-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.aion-pill-chip:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--pill-gold-light);
  color: #fff;
  transform: translateY(-1px);
}

.aion-pill-chip.active {
  background: linear-gradient(135deg, #d4af37, #8a6414);
  border-color: #f6e27a;
  color: #030508;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* Linha de Volume e Controles Secundários */
.aion-pill-bottom-ctrls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.aion-pill-vol-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.aion-pill-vol-icon {
  color: var(--pill-gold);
  font-size: 0.72rem;
  cursor: pointer;
}

.aion-pill-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 130px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.aion-pill-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pill-gold-light);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
  cursor: pointer;
}

/* Talismã Circular Flutuante (Quando Fechado/Minimizado) */
.aion-talisman-trigger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pill-bg);
  border: 1.5px solid var(--pill-border);
  box-shadow: var(--pill-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--pill-gold-light);
  font-size: 1.1rem;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
}

.aion-talisman-trigger:hover {
  transform: scale(1.12);
  border-color: #ffffff;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.75);
}

.aion-draggable-pill-wrap.is-minimized .aion-drag-pill {
  display: none;
}

.aion-draggable-pill-wrap.is-minimized .aion-talisman-trigger {
  display: flex;
}

.aion-draggable-pill-wrap.playing .aion-talisman-trigger {
  animation: talismanGlow 2s infinite ease-in-out;
}

@keyframes talismanGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(212, 175, 55, 0.35); }
  50% { box-shadow: 0 0 26px rgba(212, 175, 55, 0.85), 0 0 8px #fff; }
}

@media (max-width: 600px) {
  .aion-drag-pill {
    max-width: calc(100vw - 32px);
  }
}
