/* ============================================
   TRANSCRIPT CHAT STYLES
   Expandable AI chat panel for meeting transcripts
   ============================================ */

/* ============================================
   TOGGLE BUTTON
   ============================================ */

.transcript-chat-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.transcript-chat-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.transcript-chat-toggle-btn:active {
  transform: translateY(0);
}

.transcript-chat-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.transcript-chat-toggle-btn.active {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ============================================
   CHAT PANEL
   ============================================ */

.transcript-chat-panel {
  margin-top: 20px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.transcript-chat-panel.hidden {
  display: none;
}

/* ============================================
   HEADER
   ============================================ */

.transcript-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.transcript-chat-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.transcript-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transcript-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MESSAGES CONTAINER
   ============================================ */

.transcript-chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transcript-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.transcript-chat-messages::-webkit-scrollbar-track {
  background: #e0e0e0;
}

.transcript-chat-messages::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.transcript-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.transcript-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  text-align: center;
  padding: 40px 20px;
}

.transcript-chat-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.transcript-chat-empty-icon svg {
  width: 100%;
  height: 100%;
  fill: #667eea;
}

.transcript-chat-empty h6 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.transcript-chat-empty p {
  margin: 0;
  font-size: 14px;
  color: #666;
  max-width: 300px;
}

/* ============================================
   MESSAGE STYLES
   ============================================ */

.transcript-chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: messageSlideIn 0.3s ease;
}

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

.transcript-chat-message.user {
  align-self: flex-end;
}

.transcript-chat-message.assistant {
  align-self: flex-start;
}

.transcript-chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.transcript-chat-message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.transcript-chat-message.user .transcript-chat-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.transcript-chat-message.assistant .transcript-chat-message-avatar {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.transcript-chat-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.transcript-chat-message.user .transcript-chat-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.transcript-chat-message.assistant .transcript-chat-message-content {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.transcript-chat-message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  align-self: flex-end;
}

/* ============================================
   LOADING STATE
   ============================================ */

.transcript-chat-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  max-width: 80px;
  align-self: flex-start;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.transcript-chat-loading-dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: loadingPulse 1.4s infinite ease-in-out;
}

.transcript-chat-loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.transcript-chat-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.transcript-chat-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingPulse {
  0%, 60%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ============================================
   INPUT AREA
   ============================================ */

.transcript-chat-input-area {
  padding: 16px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

#transcript-chat-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#transcript-chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  transition: all 0.2s ease;
  line-height: 1.5;
}

#transcript-chat-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#transcript-chat-input::placeholder {
  color: #999;
}

#transcript-chat-form button[type="submit"] {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#transcript-chat-form button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

#transcript-chat-form button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

#transcript-chat-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .transcript-chat-messages {
    height: 300px;
    padding: 16px;
  }

  .transcript-chat-message {
    max-width: 90%;
  }

  .transcript-chat-header {
    padding: 12px 16px;
  }

  .transcript-chat-header h5 {
    font-size: 14px;
  }

  .transcript-chat-input-area {
    padding: 12px;
  }

  #transcript-chat-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .transcript-chat-toggle-btn {
    font-size: 13px;
    padding: 8px 12px;
  }

  .transcript-chat-toggle-btn svg {
    width: 16px;
    height: 16px;
  }

  .transcript-chat-messages {
    height: 250px;
    padding: 12px;
    gap: 12px;
  }

  .transcript-chat-message {
    max-width: 95%;
  }

  .transcript-chat-message-content {
    padding: 10px 12px;
    font-size: 13px;
  }

  .transcript-chat-empty {
    padding: 30px 16px;
  }

  .transcript-chat-empty-icon {
    width: 48px;
    height: 48px;
  }

  .transcript-chat-empty h6 {
    font-size: 16px;
  }

  .transcript-chat-empty p {
    font-size: 13px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.transcript-chat-error {
  padding: 12px 16px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  color: #c33;
  font-size: 14px;
  text-align: center;
  margin: 0 20px;
}

.transcript-chat-info {
  padding: 8px 12px;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 6px;
  color: #1976d2;
  font-size: 12px;
  text-align: center;
  margin: -8px 0 8px 0;
}
