/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import Manrope font weights */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap');

/* Import Bootstrap */
@import "bootstrap.css";
@import "@fortawesome/fontawesome-free/css/all.css";
@import "landing_conversation.css";
@import "selection_nudge.css";
@import "tooltips.css";

/* Set background color for all pages except conversation page */
body:not(.conversation-page) {
  background-color: FFE7CF;
}

/* Custom styles */
.conversation-container {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.messages-container {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.message {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 10px;
  max-width: 80%;
}

.ai-message {
  margin-right: auto;
}

.user-message {
  margin-left: auto;
}

.message-header {
  margin-bottom: 5px;
}

.message-actions {
  margin-top: 5px;
  display: flex;
  gap: 5px;
}

.user-input-container {
  padding: 15px;
  border-top: 1px solid #ddd;
  background-color: #fff;
}

.recording-status {
  text-align: center;
  margin-bottom: 10px;
  font-style: italic;
}

/* Override all font instances with Manrope - using higher specificity */
html body .message-content,
html body .ai-message,
html body .user-message,
html body .message-content p,
html body .message-content div,
html body .message-content span,
html body .ai-message .message-content,
html body .user-message .message-content,
html body .ai-message p,
html body .user-message p,
html body .message *,
html body .message-content *,
html body .ai-message *,
html body .user-message * {
  font-family: 'Manrope', sans-serif !important;
  font-weight: 500 !important;
  color: #5A4535 !important;
}

/* Text selection explanation styles */
.explanation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.explanation-content {
  background-color: white;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.explanation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.explanation-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-explanation {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.explanation-body {
  padding: 20px;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #666;
}

.loading-spinner > div {
  width: 12px;
  height: 12px;
  margin: 0 4px;
  border-radius: 50%;
  background-color: #17a2b8;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-spinner > div:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-spinner > div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% { 
    transform: scale(0);
  } 40% { 
    transform: scale(1.0);
  }
}

.explanation-text {
  line-height: 1.6;
}

.diff-explanation-container {
  background-color: #f8f9fa;
  border-radius: 5px;
  padding: 15px;
  margin-top: 10px;
  font-size: 14px;
}

.diff-explanation-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.diff-explanation-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.diff-explanation-before {
  color: #dc3545;
  font-weight: 500;
  margin-bottom: 5px;
}

.diff-explanation-after {
  color: #28a745;
  font-weight: 500;
  margin-bottom: 5px;
}

.diff-explanation-reason {
  color: #6c757d;
}

.explanation-error {
  color: #d9534f;
  padding: 10px;
  border: 1px solid #d9534f;
  border-radius: 4px;
  background-color: #f9f2f2;
}

/* Add this to your CSS */
.no-speech {
  display: inline;
  /* Modern CSS property for screen readers */
  -webkit-user-select: none;
  user-select: none;
  /* aria-hidden is an HTML attribute, not a CSS property */
  /* Use a CSS class instead and add the attribute in HTML */
}

/* Styling for the explain button with just a question mark icon */
.explain-button {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background-color: #17a2b8 !important;
  color: white !important;
  border: none !important;
  border-radius: 50% !important;
  font-size: 16px !important;
  padding: 0 !important;
  text-align: center !important;
  /* Explicitly override any width/height settings */
  width: auto !important;
  height: auto !important;
}

/* Super specific selector to override any other styles */
html body .message .explain-button,
html body .message-buttons .explain-button,
html body .message-content .explain-button,
html body .message-actions .explain-button,
html body .ai-message .explain-button,
html body .user-message .explain-button {
  /* Removed width and height auto to fix sizing issues */
  line-height: normal !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

.explain-button::before {
  content: "?" !important;
  font-weight: bold !important;
}

/* Hide the text "Explain" */
.explain-button span {
  display: none !important;
}

/* Fixed size explain button class to override the auto width/height */
.fixed-size-explain-button {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}

/* FORCE MANROPE FONT - MAXIMUM SPECIFICITY OVERRIDE */
html body div.message.user-message div.message-content,
html body div.message.ai-message div.message-content,
html body div.message.user-message div.message-content *,
html body div.message.ai-message div.message-content *,
html body div.message.user-message div.message-content p,
html body div.message.ai-message div.message-content p,
html body div.message.user-message div.message-content div,
html body div.message.ai-message div.message-content div,
html body div.message.user-message div.message-content span,
html body div.message.ai-message div.message-content span,
html body div.message.user-message div.no-diff-view,
html body div.message.ai-message div.no-diff-view,
html body div.message.user-message div.diff-view,
html body div.message.ai-message div.diff-view {
  font-family: 'Manrope', sans-serif !important;
  font-weight: 500 !important;
}