/* Karaoke App Styles */

* {
  scrollbar-width: thin;
  scrollbar-color: #374151 transparent;
}

*::-webkit-scrollbar {
  width: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: #374151;
  border-radius: 3px;
}

/* Video Grid */
.video-grid-layout {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.video-tile {
  position: relative;
  background: #111827;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.video-tile.speaking {
  border-color: #ec4899;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.video-tile .video-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-size: 13px;
  font-weight: 500;
}

.video-tile .video-muted {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-tile .video-avatar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: #1f2937;
}

/* Control Buttons */
.control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #374151;
  transition: all 0.2s;
  border: none;
  color: white;
  cursor: pointer;
}

.control-btn:hover {
  background: #4b5563;
}

.control-btn.active {
  background: #374151;
}

.control-btn.muted {
  background: #dc2626;
}

.control-btn-text {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #374151;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  color: white;
  cursor: pointer;
}

.control-btn-text:hover {
  background: #4b5563;
}

.control-btn-ptt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #374151;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  color: white;
  cursor: pointer;
  user-select: none;
}

.control-btn-ptt:hover {
  background: #4b5563;
}

.control-btn-ptt.recording {
  background: #dc2626;
  animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* Lyrics */
.lyrics-container {
  text-align: center;
}

.lyrics-line {
  font-size: 18px;
  line-height: 2;
  color: #6b7280;
  transition: all 0.3s;
  padding: 2px 8px;
  border-radius: 4px;
}

.lyrics-line.active {
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  text-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}

.lyrics-line.past {
  color: #9ca3af;
}

/* Chat Messages */
.chat-msg {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.chat-msg .chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: #374151;
}

.chat-msg.host-msg .chat-avatar {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

.chat-msg .chat-name {
  font-weight: 600;
  font-size: 13px;
}

.chat-msg.host-msg .chat-name {
  color: #ec4899;
}

.chat-msg .chat-text {
  color: #d1d5db;
  word-break: break-word;
}

/* Now Playing Animation */
.now-playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.now-playing-bars span {
  width: 3px;
  background: #ec4899;
  border-radius: 1px;
  animation: bar-bounce 1s ease-in-out infinite;
}

.now-playing-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.now-playing-bars span:nth-child(2) { height: 70%; animation-delay: 0.2s; }
.now-playing-bars span:nth-child(3) { height: 50%; animation-delay: 0.4s; }

@keyframes bar-bounce {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* Host Avatar Speaking */
#host-avatar.speaking {
  animation: host-pulse 1s ease-in-out infinite;
}

@keyframes host-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); }
}

/* Song List Item */
.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #1f2937;
  border-radius: 8px;
  transition: background 0.2s;
}

.song-item:hover {
  background: #374151;
}

.song-item .song-info {
  min-width: 0;
}

.song-item .song-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-item .song-artist {
  font-size: 12px;
  color: #9ca3af;
}

.song-item .song-queue-btn {
  padding: 6px 14px;
  border-radius: 6px;
  background: #ec4899;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
  border: none;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
}

.song-item .song-queue-btn:hover {
  background: #db2777;
}

/* Room Card */
.room-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s;
  cursor: pointer;
}

.room-card:hover {
  border-color: #374151;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Queue item in modal */
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.queue-item .queue-pos {
  color: #6b7280;
  font-size: 12px;
  width: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .video-grid-layout {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
