/**
 * Admin Message Board / Team Updates Styles
 * Desktop version of the mobile Team Updates feature
 * 
 * Displays team announcements and messages on the admin dashboard.
 * Allows admins to post updates visible to all team members.
 */

/* ========================================
   MESSAGE BOARD PANEL
   ======================================== */
.message-board-panel {
  background: var(--admin-panel, #0e1014);
  border: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  overflow: hidden;
}

.message-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  border-bottom: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
}

.message-board-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--admin-text, #fff);
}

.message-board-title i {
  color: #3b82f6;
}

.message-board-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.message-board-add-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

/* ========================================
   MESSAGE LIST
   ======================================== */
.message-board-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.message-board-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--admin-text-muted, #a0a0a0);
}

.message-board-empty i {
  font-size: 32px;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
}

/* Individual message item */
.message-item {
  padding: 14px 16px;
  background: var(--admin-card, #141414);
  border: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.message-item:last-child {
  margin-bottom: 0;
}

.message-item:hover {
  border-color: var(--admin-line-strong, rgba(255, 255, 255, 0.15));
}

.message-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.message-item-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b2b 0%, #ff8f5a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
}

.message-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text, #fff);
}

.message-item-time {
  font-size: 11px;
  color: var(--admin-text-muted, #a0a0a0);
}

.message-item-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--admin-text, #fff);
  margin-bottom: 4px;
}

.message-item-content {
  font-size: 14px;
  color: var(--admin-text-secondary, #e8e8e8);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Voice message styles */
.message-item.voice .message-item-avatar {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

.message-item.voice .message-item-avatar i {
  font-size: 12px;
}

.message-item-voice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  margin-top: 8px;
}

.voice-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #8b5cf6;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.voice-play-btn:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

.voice-play-btn.playing {
  background: #7c3aed;
}

.voice-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 24px;
}

.voice-waveform span {
  width: 3px;
  background: rgba(139, 92, 246, 0.5);
  border-radius: 2px;
  transition: background 0.2s;
}

.message-item-voice:hover .voice-waveform span {
  background: rgba(139, 92, 246, 0.7);
}

.voice-duration {
  font-size: 12px;
  color: var(--admin-text-muted, #a0a0a0);
  font-family: 'Montserrat', sans-serif;
  flex-shrink: 0;
}

.message-item-transcription {
  font-size: 13px;
  color: var(--admin-text-muted, #a0a0a0);
  font-style: italic;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  line-height: 1.4;
}

.message-item-transcription i {
  color: rgba(139, 92, 246, 0.6);
  margin-right: 6px;
  font-size: 10px;
}

/* Priority styles */
.message-item.priority-high {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.message-item.priority-urgent {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

.message-item-priority {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

.message-item-priority.high {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.message-item-priority.urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.message-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
}

.message-item-action {
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--admin-text-muted, #a0a0a0);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.message-item-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-text, #fff);
}

.message-item-action.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Pinned message styling */
.message-item.pinned {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.message-item.pinned .message-item-pin {
  color: #f59e0b;
  font-size: 10px;
  margin-left: 8px;
}

/* ========================================
   ADD MESSAGE MODAL
   ======================================== */
.message-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.message-modal.open {
  display: flex;
}

.message-modal-content {
  background: var(--admin-panel, #0e1014);
  border: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.message-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
}

.message-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--admin-text, #fff);
}

.message-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--admin-text-muted, #a0a0a0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.message-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.message-modal-body {
  padding: 20px;
}

.message-modal-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: var(--admin-input, #0d0f13);
  color: var(--admin-text, #fff);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s;
}

.message-modal-textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.message-modal-textarea::placeholder {
  color: var(--admin-text-muted, #a0a0a0);
}

.message-modal-options {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.message-modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--admin-text-secondary, #e8e8e8);
  cursor: pointer;
}

.message-modal-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
}

.message-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
}

.message-modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--admin-text-secondary, #e8e8e8);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.message-modal-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.message-modal-btn.primary {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.message-modal-btn.primary:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
}

/* ========================================
   LOADING STATE
   ======================================== */
.message-board-loading {
  text-align: center;
  padding: 24px;
  color: var(--admin-text-muted, #a0a0a0);
  font-size: 13px;
}

.message-board-loading i {
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   MODE TOGGLE TABS (Text/Voice)
   ======================================== */
.message-mode-tabs {
  display: flex;
  border-bottom: 1px solid var(--admin-line, rgba(255, 255, 255, 0.1));
}

.message-mode-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--admin-text-muted, #a0a0a0);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.message-mode-tab:hover {
  color: var(--admin-text, #fff);
  background: rgba(255, 255, 255, 0.03);
}

.message-mode-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.message-mode-tab i {
  font-size: 14px;
}

/* ========================================
   VOICE MODE SECTION
   ======================================== */
.message-voice-mode {
  padding: 20px 0;
}

.voice-recorder-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

/* Large record button */
.voice-record-btn-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #8b5cf6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s;
}

.voice-record-btn-large:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(139, 92, 246, 0.5);
  transform: scale(1.05);
}

.voice-record-btn-large.recording {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
  color: #fff;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

/* Voice status text */
.voice-status {
  font-size: 14px;
  color: var(--admin-text-muted, #a0a0a0);
  font-family: 'Montserrat', sans-serif;
}

/* Voice timer */
.voice-timer {
  font-size: 24px;
  font-weight: 600;
  color: #8b5cf6;
  font-family: 'Montserrat', sans-serif;
}

/* Animated waveform during recording */
.voice-waveform-animated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  opacity: 0.3;
}

.voice-waveform-animated span {
  width: 4px;
  height: 8px;
  background: #8b5cf6;
  border-radius: 2px;
  transition: height 0.1s;
}

.voice-waveform-animated.active {
  opacity: 1;
}

.voice-waveform-animated.active span {
  animation: waveform-animate 0.5s ease-in-out infinite alternate;
}

.voice-waveform-animated.active span:nth-child(1) { animation-delay: 0s; }
.voice-waveform-animated.active span:nth-child(2) { animation-delay: 0.1s; }
.voice-waveform-animated.active span:nth-child(3) { animation-delay: 0.2s; }
.voice-waveform-animated.active span:nth-child(4) { animation-delay: 0.3s; }
.voice-waveform-animated.active span:nth-child(5) { animation-delay: 0.4s; }
.voice-waveform-animated.active span:nth-child(6) { animation-delay: 0.4s; }
.voice-waveform-animated.active span:nth-child(7) { animation-delay: 0.3s; }
.voice-waveform-animated.active span:nth-child(8) { animation-delay: 0.2s; }
.voice-waveform-animated.active span:nth-child(9) { animation-delay: 0.1s; }
.voice-waveform-animated.active span:nth-child(10) { animation-delay: 0s; }

@keyframes waveform-animate {
  0% { height: 8px; }
  100% { height: 32px; }
}

/* ========================================
   VOICE PREVIEW SECTION
   ======================================== */
.voice-preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.voice-preview-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  width: 100%;
  max-width: 320px;
}

.voice-preview-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #8b5cf6;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.voice-preview-play-btn:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

.voice-preview-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 32px;
}

.voice-preview-waveform span {
  width: 3px;
  height: 12px;
  background: rgba(139, 92, 246, 0.5);
  border-radius: 2px;
}

.voice-preview-waveform span:nth-child(odd) { height: 18px; }
.voice-preview-waveform span:nth-child(3n) { height: 24px; }
.voice-preview-waveform span:nth-child(5n) { height: 8px; }

.voice-preview-waveform.playing span {
  animation: playback-wave 0.4s ease-in-out infinite alternate;
}

.voice-preview-waveform.playing span:nth-child(1) { animation-delay: 0s; }
.voice-preview-waveform.playing span:nth-child(2) { animation-delay: 0.05s; }
.voice-preview-waveform.playing span:nth-child(3) { animation-delay: 0.1s; }
.voice-preview-waveform.playing span:nth-child(4) { animation-delay: 0.15s; }
.voice-preview-waveform.playing span:nth-child(5) { animation-delay: 0.2s; }
.voice-preview-waveform.playing span:nth-child(6) { animation-delay: 0.25s; }
.voice-preview-waveform.playing span:nth-child(7) { animation-delay: 0.3s; }
.voice-preview-waveform.playing span:nth-child(8) { animation-delay: 0.35s; }
.voice-preview-waveform.playing span:nth-child(9) { animation-delay: 0.3s; }
.voice-preview-waveform.playing span:nth-child(10) { animation-delay: 0.25s; }
.voice-preview-waveform.playing span:nth-child(11) { animation-delay: 0.2s; }
.voice-preview-waveform.playing span:nth-child(12) { animation-delay: 0.15s; }

@keyframes playback-wave {
  0% { transform: scaleY(0.6); background: rgba(139, 92, 246, 0.4); }
  100% { transform: scaleY(1.2); background: #8b5cf6; }
}

.voice-preview-duration {
  font-size: 14px;
  font-weight: 600;
  color: #8b5cf6;
  font-family: 'Montserrat', sans-serif;
  flex-shrink: 0;
}

/* Transcription status */
.voice-transcription-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  color: var(--admin-text-muted, #a0a0a0);
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
}

.voice-transcription-status i {
  color: #8b5cf6;
}

/* Transcription result */
.voice-transcription-result {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 8px 8px 0;
}

.voice-transcription-result .transcription-label {
  font-size: 10px;
  font-weight: 600;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-transcription-result .transcription-label i {
  font-size: 8px;
  opacity: 0.7;
}

.voice-transcription-result .transcription-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--admin-text-secondary, #e8e8e8);
  font-style: italic;
}

/* Re-record button */
.voice-re-record-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--admin-line-strong, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--admin-text-muted, #a0a0a0);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.voice-re-record-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-text, #fff);
}
