/* Estilos para el reproductor de música */
.music-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: var(--bg-secondary, #2a3942);
  border: 1px solid rgba(0, 168, 132, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  font-family: inherit;
  backdrop-filter: blur(10px);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.music-panel.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.music-panel.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

.music-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 168, 132, 0.1);
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid rgba(0, 168, 132, 0.2);
  color: var(--text-primary, #e9edef);
  font-weight: 500;
}

.music-toggle {
  background: none;
  border: none;
  color: var(--text-primary, #e9edef);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.music-toggle:hover {
  background: rgba(0, 168, 132, 0.2);
}

.music-content {
  padding: 12px;
}

.track-info {
  text-align: center;
  margin-bottom: 12px;
}

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e9edef);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12px;
  color: var(--text-secondary, #8696a0);
}

.progress-container {
  margin-bottom: 12px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(134, 150, 160, 0.3);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary, #00a884);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary, #8696a0);
}

.music-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.control-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.2s;
  color: var(--text-primary, #e9edef);
}

.control-btn:hover {
  background: rgba(0, 168, 132, 0.2);
  transform: scale(1.1);
}

.play-btn {
  font-size: 20px;
  background: var(--primary, #00a884);
  color: white;
}

.play-btn:hover {
  background: var(--primary-hover, #00967a);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.volume-control span {
  font-size: 14px;
}

.volume-control input[type="range"] {
  flex: 1;
  height: 4px;
  background: rgba(134, 150, 160, 0.3);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary, #00a884);
  border-radius: 50%;
  cursor: pointer;
}

.volume-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary, #00a884);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.playlist-section {
  border-top: 1px solid rgba(134, 150, 160, 0.2);
  padding-top: 12px;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--text-primary, #e9edef);
  font-weight: 500;
  font-size: 13px;
}

.playlist {
  max-height: 150px;
  overflow-y: auto;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 2px;
}

.playlist-item:hover {
  background: rgba(0, 168, 132, 0.1);
}

.playlist-item.active {
  background: rgba(0, 168, 132, 0.2);
  border: 1px solid rgba(0, 168, 132, 0.4);
}

.playlist-item .track-info {
  text-align: left;
  margin: 0;
  flex: 1;
}

.playlist-item .track-name {
  font-size: 13px;
  color: var(--text-primary, #e9edef);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item .track-artist {
  font-size: 11px;
  color: var(--text-secondary, #8696a0);
  margin: 0;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-duration {
  font-size: 11px;
  color: var(--text-secondary, #8696a0);
}

.remove-btn {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  transition: background 0.2s;
  color: #f15c6d;
}

.remove-btn:hover {
  background: rgba(241, 92, 109, 0.2);
}

/* Modal de subida de música */
.music-upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.music-upload-modal .modal-content {
  background: var(--bg-secondary, #2a3942);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  color: var(--text-primary, #e9edef);
}

.music-upload-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary, #8696a0);
  padding: 4px;
}

.close-modal:hover {
  color: var(--text-primary, #e9edef);
}

.upload-warning {
  background: rgba(241, 196, 15, 0.1);
  border: 1px solid rgba(241, 196, 15, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  color: #f1c40f;
  font-size: 14px;
  line-height: 1.5;
}

.upload-section {
  margin-bottom: 20px;
}

.upload-section input[type="file"] {
  display: none;
}

.upload-btn {
  display: inline-block;
  background: var(--primary, #00a884);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.upload-btn:hover {
  background: var(--primary-hover, #00967a);
}

.upload-info {
  color: var(--text-secondary, #8696a0);
  font-size: 14px;
  line-height: 1.5;
}

.upload-info p {
  margin: 8px 0;
}

/* Notificación de música */
.music-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-secondary, #2a3942);
  color: var(--text-primary, #e9edef);
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid rgba(0, 168, 132, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.music-notification.show {
  transform: translateX(0);
}

/* Responsive */
@media (max-width: 768px) {
  .music-panel {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    bottom: 80px;
  }
  
  .music-panel.hidden {
    transform: translateY(150%);
  }
  
  .music-panel.show {
    transform: translateY(0);
  }
  
  .music-upload-modal .modal-content {
    width: 95%;
    padding: 20px;
  }
}

/* Scrollbar personalizado para la playlist */
.playlist::-webkit-scrollbar {
  width: 6px;
}

.playlist::-webkit-scrollbar-track {
  background: rgba(134, 150, 160, 0.1);
  border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb {
  background: rgba(0, 168, 132, 0.5);
  border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 168, 132, 0.7);
}

/* Estilos para tamaños de fuente */
.font-small {
  font-size: 14px;
}

.font-small .message {
  font-size: 13px;
}

.font-small .chat-name {
  font-size: 14px;
}

.font-medium {
  font-size: 16px;
}

.font-medium .message {
  font-size: 15px;
}

.font-medium .chat-name {
  font-size: 16px;
}

.font-large {
  font-size: 18px;
}

.font-large .message {
  font-size: 17px;
}

.font-large .chat-name {
  font-size: 18px;
}

/* Ajustes para el panel de música en diferentes tamaños */
.font-small .music-panel {
  font-size: 13px;
}

.font-large .music-panel {
  font-size: 17px;
}

/* Mejoras para el botón de música en el mini sidebar */
.mini-sidebar-btn[title="Música"] {
  position: relative;
}

.mini-sidebar-btn[title="Música"].music-playing {
  animation: pulse-music 1.5s ease-in-out infinite;
}

@keyframes pulse-music {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(0, 168, 132, 0);
  }
}

.mini-sidebar-btn[title="Música"].music-playing::before {
  content: "🎵";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 12px;
  animation: bounce-note 1s ease-in-out infinite;
}

@keyframes bounce-note {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.mini-sidebar-btn[title="Música"]:hover::after {
  content: "🎵 Reproductor";
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-secondary, #2a3942);
  color: var(--text-primary, #e9edef);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  border: 1px solid rgba(0, 168, 132, 0.3);
}