/* ============================================
   Crossfire Mode - Professional Style
   ============================================ */

/* Crossfire Setup */
.crossfire-setup {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

/* Topic Controls */
.topic-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Crossfire Chat */
.crossfire-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.crossfire-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(20, 22, 32, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
}

.crossfire-participants {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--border-default);
  transition: all 0.3s var(--ease-out);
  overflow: hidden;
  position: relative;
}

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

.participant-avatar.speaking {
  transform: scale(1.1);
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(58, 123, 255, 0.4);
}

.participant-avatar .initial {
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.crossfire-controls {
  display: flex;
  gap: 8px;
}

/* Crossfire Messages */
.crossfire-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.crossfire-message {
  display: flex;
  gap: 14px;
  animation: messageIn 0.3s var(--ease-out);
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crossfire-message .message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--border-default);
  overflow: hidden;
}

.crossfire-message .message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.crossfire-message .message-avatar .initial {
  color: var(--accent-blue);
}

.crossfire-message .message-content {
  flex: 1;
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crossfire-message .message-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-left: 4px;
}

.crossfire-message .bubble {
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* Status Bar */
.crossfire-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(20, 22, 32, 0.8);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
}

#statusText {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* Voice Mode Card */
.voice-mode-card {
  margin-top: 16px;
}

.voice-mode-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.voice-option {
  flex: 1;
  min-width: 140px;
  cursor: pointer;
}

.voice-option input {
  display: none;
}

.voice-option .option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.voice-option .option-content svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.voice-option .option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-option .option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.voice-option .option-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.voice-option input:checked + .option-content {
  border-color: var(--accent-blue);
  background: rgba(58, 123, 255, 0.1);
}

.voice-option input:checked + .option-content svg {
  color: var(--accent-blue);
}

.voice-option:hover .option-content {
  border-color: var(--border-default);
  background: var(--bg-card);
}

/* Speak button in crossfire messages */
.crossfire-message .bubble {
  position: relative;
}

.crossfire-message .speak-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(58, 123, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}

.crossfire-message .bubble:hover .speak-btn {
  opacity: 1;
}

.crossfire-message .speak-btn svg {
  width: 14px;
  height: 14px;
  color: var(--accent-blue);
}

.crossfire-message .speak-btn:hover {
  background: rgba(58, 123, 255, 0.3);
  transform: scale(1.1);
}

.crossfire-message .speak-btn.playing {
  opacity: 1;
  background: var(--accent-blue);
}

.crossfire-message .speak-btn.playing svg {
  color: white;
}

/* Audio playing indicator on avatar */
.participant-avatar.audio-playing {
  animation: audioPulse 1s ease-in-out infinite;
}

@keyframes audioPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 123, 255, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(58, 123, 255, 0); }
}

/* Playing message highlight (Spotify lyrics style) */
.crossfire-message.playing {
  background: rgba(58, 123, 255, 0.08);
  border-radius: 12px;
  margin: -8px;
  padding: 8px;
  transition: all 0.3s ease;
}

.crossfire-message.playing .bubble {
  border-color: var(--accent-blue);
  background: rgba(58, 123, 255, 0.15);
}

.crossfire-message.playing .message-name {
  color: var(--accent-blue);
}

/* Voice indicator next to name */
.voice-indicator {
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.7;
}

/* Play All button styling */
.control-btn.voice-control {
  gap: 6px;
  padding: 8px 14px;
  background: rgba(58, 123, 255, 0.15);
  border-color: var(--accent-blue);
}

.control-btn.voice-control span {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-blue);
}

.control-btn.voice-control:hover {
  background: rgba(58, 123, 255, 0.25);
}

.control-btn.voice-control.playing {
  background: var(--accent-blue);
}

.control-btn.voice-control.playing span,
.control-btn.voice-control.playing svg {
  color: white;
}

/* Speak button in one-on-one chat */
.message .bubble {
  position: relative;
}

.message .speak-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(58, 123, 255, 0.12);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}

.message .bubble:hover .speak-btn {
  opacity: 1;
}

.message .speak-btn svg {
  width: 13px;
  height: 13px;
  color: var(--accent-blue);
}

.message .speak-btn:hover {
  background: rgba(58, 123, 255, 0.25);
  transform: scale(1.1);
}

.message .speak-btn.playing {
  opacity: 1;
  background: var(--accent-blue);
}

.message .speak-btn.playing svg {
  color: white;
}

/* Mobile */
@media (max-width: 768px) {
  .crossfire-header {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .crossfire-participants {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-top: 12px;
    gap: 6px;
  }

  .participant-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .crossfire-controls {
    gap: 6px;
  }

  .crossfire-messages {
    padding: 16px;
    gap: 16px;
  }

  .crossfire-message .message-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .crossfire-message .message-content {
    max-width: 85%;
  }

  .crossfire-message .bubble {
    padding: 12px 16px;
    font-size: 15px;
  }

  .crossfire-status {
    padding: 14px 16px;
  }
}
