/* Apple Touchpad Style Control Panel */
.control-panel {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999997;
  width: 0;
  height: 0;
  pointer-events: none;
}

.control-panel__toggle {
  position: absolute;
  bottom: 0;
  right: 0;
  display: grid;
  width: 46px;
  height: 92px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  color: #fff;
  cursor: pointer;
  transform: translateY(0);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-right: 0;
  border-radius: 23px 0 0 23px;
  background: rgba(21, 30, 64, 0.52);
  box-shadow: -6px 8px 28px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
  transition: all 0.3s ease;
}

.control-panel__toggle > i {
  z-index: 1;
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}

.control-panel__toggle:hover > i,
.control-panel__toggle:focus-visible > i {
  transform: scale(1.12);
}

.control-toggle__echo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

.control-panel.is-open .control-toggle__echo:nth-child(1) { animation: discord-echo 2.4s infinite; }
.control-panel.is-open .control-toggle__echo:nth-child(2) { animation: discord-echo 2.4s infinite 0.8s; }
.control-panel.is-open .control-toggle__echo:nth-child(3) { animation: discord-echo 2.4s infinite 1.6s; }

@keyframes discord-echo {
  0% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.7); }
  70% { opacity: 0.08; transform: translate(-50%, -50%) scale(2.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
}

.control-panel__surface {
  position: absolute;
  bottom: 110px;
  right: 0;
  width: 320px;
  max-height: 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(20, 25, 40, 0.9);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(125, 211, 252, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
              inset 0 1px 1px rgba(125, 211, 252, 0.1);
  pointer-events: auto;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0;
}

.control-panel.is-open .control-panel__surface {
  max-height: 400px;
  padding: 20px;
  animation: panel-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Control Sections */
.control-section {
  padding: 16px 0;
  color: rgba(255, 255, 255, 0.9);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(125, 211, 252, 0.8);
  margin-bottom: 12px;
}

.section-title i {
  font-size: 1rem;
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right,
              transparent 0%,
              rgba(125, 211, 252, 0.3) 50%,
              transparent 100%);
  margin: 16px 0;
}

/* Discord Section */
.discord-section {
  padding-top: 0;
}

.discord-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #747F8D;
  box-shadow: 0 0 10px rgba(116, 127, 141, 0.5);
  transition: all 0.3s ease;
}

.status-dot.online {
  background: #3BA55D;
  box-shadow: 0 0 12px rgba(59, 165, 93, 0.8);
}

.status-dot.idle {
  background: #FAA81A;
  box-shadow: 0 0 12px rgba(250, 168, 26, 0.8);
}

.status-dot.dnd {
  background: #ED4245;
  box-shadow: 0 0 12px rgba(237, 66, 69, 0.8);
}

.status-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: capitalize;
}

.discord-activity {
  font-size: 0.8rem;
  color: rgba(125, 211, 252, 0.7);
  min-height: 18px;
  padding: 5px 0;
}

/* Music Section */
.music-section {
  padding-bottom: 0;
}

.music-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(125, 211, 252, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.1);
}

.album-art-mini {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7dd3fc 0%, #5865F2 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.music-details {
  flex: 1;
  min-width: 0;
}

.song-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-name {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 4px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-controls {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.3);
  color: rgba(125, 211, 252, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.control-btn:hover {
  background: rgba(125, 211, 252, 0.2);
  box-shadow: 0 0 15px rgba(125, 211, 252, 0.3);
  transform: scale(1.05);
}

.control-btn:active {
  transform: scale(0.95);
}

.play-btn {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.3), rgba(93, 165, 255, 0.2));
}

.play-btn:hover {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.5), rgba(93, 165, 255, 0.4));
  box-shadow: 0 0 20px rgba(125, 211, 252, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .control-panel {
    bottom: 20px;
    right: 20px;
  }

  .control-panel__toggle {
    width: 42px;
    height: 82px;
  }

  .control-panel__surface {
    width: 280px;
  }

  .section-title {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .control-panel {
    bottom: 15px;
    right: 15px;
  }

  .control-panel__toggle {
    width: 40px;
    height: 76px;
  }

  .control-panel__surface {
    width: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .control-panel__surface,
  .control-panel__toggle {
    transition: none;
  }
  
  .control-btn {
    transition: none;
  }
}
