/**
 * Styles CSS dédiés au web search ChatGPT 5 et 5 Mini
 * Version: 1.4.33
 * Séparé du template pour éviter les conflits
 */

/* Indicateurs de web search */
.web-search-enabled .chatgpt-output .ccgpt-bot-message {
  border-left: 3px solid #4f46e5;
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

.web-search-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #3b82f6;
  color: white;
  border-radius: 12px;
  font-size: 11px;
  margin-bottom: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Citations web */
.web-citations {
  margin-top: 12px;
  padding: 8px;
  background: #f1f5f9;
  border-radius: 6px;
  border-left: 3px solid #0ea5e9;
}

.web-citations h5 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.web-citations a {
  display: block;
  color: #0ea5e9;
  text-decoration: none;
  font-size: 11px;
  margin-bottom: 2px;
}

.web-citations a:hover {
  text-decoration: underline;
}

/* Badge web search */
.web-search-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.web-search-badge svg {
  width: 12px;
  height: 12px;
}

.chatgpt-container .web-search-badge {
  margin-left: auto;
  margin-right: 8px;
}

/* Animation de chargement (spinner + points) */
.ccgpt-bot-message.ccgpt-loading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ccgpt-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #bfdbfe; /* bleu clair */
  border-top-color: #2563eb; /* bleu */
  border-radius: 50%;
  animation: ccgpt-spin 1s linear infinite;
}

@keyframes ccgpt-spin {
  to {
    transform: rotate(360deg);
  }
}

.ccgpt-dots-bounce {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.ccgpt-dots-bounce span {
  width: 4px;
  height: 4px;
  background: #2563eb;
  border-radius: 50%;
  display: inline-block;
  animation: ccgpt-bounce 1.2s infinite ease-in-out;
}

.ccgpt-dots-bounce span:nth-child(2) {
  animation-delay: 0.2s;
}

.ccgpt-dots-bounce span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ccgpt-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== STYLES MODERNES INSPIRÉS DE CHATGPT/CLAUDE ===== */

/* Typographie message (hérite du thème pour cohérence) */
.ccgpt-message {
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  font-size: inherit;
}

/* Code inline */
.ccgpt-message code {
  background: #f1f5f9;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
    "Courier New", monospace;
  font-size: 0.875em;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* Container pour bloc de code avec header */
.ccgpt-code-container {
  background: #0f172a;
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid #1e293b;
  position: relative;
}

/* Header du bloc de code */
.ccgpt-code-header {
  background: #0f172a;
  border-bottom: 1px solid #334155;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  font-size: 11px;
  color: #cbd5e1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ccgpt-code-language {
  font-weight: 500;
  text-transform: lowercase;
  color: #e2e8f0;
}

/* Bouton de copie dans le header */
.ccgpt-code-copy-btn {
  background: transparent !important;
  border: none !important;
  color: #e5e7eb !important;
  padding: 0 !important;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  line-height: 1;
  font-size: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ccgpt-code-copy-btn:hover {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #ffffff !important;
}

.ccgpt-code-copy-btn:active {
  transform: scale(0.95);
}

.ccgpt-code-copy-btn.ccgpt-copied {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.ccgpt-code-copy-btn svg {
  width: 14px;
  height: 14px;
}

/* Spécificité accrue pour neutraliser d'éventuels styles globaux */
.ccgpt-code-header .ccgpt-code-copy-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1;
  box-shadow: none !important;
}

.ccgpt-code-header .ccgpt-code-copy-btn:hover {
  background: rgba(148, 163, 184, 0.14) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

.ccgpt-code-header .ccgpt-code-copy-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35) !important;
}

.ccgpt-code-copy-btn svg {
  pointer-events: none;
}

/* Blocs de code */
.ccgpt-message pre {
  background: transparent;
  color: #e2e8f0;
  padding: 16px 20px;
  margin: 0;
  overflow-x: auto;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
    "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  border: none;
  border-radius: 0 0 12px 12px;
}

.ccgpt-message pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  border: none;
  font-weight: normal;
  font-size: inherit;
}

/* Titres avec style moderne */
.ccgpt-message h1,
.ccgpt-message h2,
.ccgpt-message h3 {
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 16px;
  color: #111827;
  letter-spacing: -0.025em;
}

.ccgpt-message h1 {
  font-size: 1.875em;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
}

.ccgpt-message h2 {
  font-size: 1.5em;
}

.ccgpt-message h3 {
  font-size: 1.25em;
}

.ccgpt-message h4,
.ccgpt-message h5,
.ccgpt-message h6 {
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 12px;
  color: #374151;
  font-size: 1em;
}

/* Listes avec espacement moderne */
.ccgpt-message ul,
.ccgpt-message ol {
  margin: 16px 0;
  padding-left: 24px;
  list-style-position: outside;
}

.ccgpt-message li {
  margin: 8px 0;
  line-height: 1.6;
}

.ccgpt-message ul li {
  list-style-type: disc;
}

.ccgpt-message ol li {
  list-style-type: decimal;
}

/* Paragraphes */
.ccgpt-message p {
  margin: 16px 0;
  line-height: 1.7;
}

.ccgpt-message p:first-child {
  margin-top: 0;
}

.ccgpt-message p:last-child {
  margin-bottom: 0;
}

/* Citations avec style moderne */
.ccgpt-message blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Texte en gras et italique */
.ccgpt-message strong {
  font-weight: 600;
  color: #111827;
}

.ccgpt-message em {
  font-style: italic;
  color: #374151;
}

/* Tables (si utilisées) */
.ccgpt-message table {
  border-collapse: collapse;
  margin: 16px 0;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ccgpt-message th,
.ccgpt-message td {
  border: 1px solid #e5e7eb;
  padding: 12px 16px;
  text-align: left;
}

.ccgpt-message th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.ccgpt-message td {
  background: #fff;
}

/* Liens */
.ccgpt-message a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.ccgpt-message a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Séparateurs */
.ccgpt-message hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

/* ===== STYLES MODERNES POUR LES BOUTONS DE COPIE ===== */

/* Style pour le bouton de copie des messages - Design moderne */
.ccgpt-btn-default {
  background: #f8f9fa !important;
  color: #6b7280 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.ccgpt-btn-default:hover {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-1px) !important;
}

.ccgpt-btn-default:active {
  background: #e5e7eb !important;
  transform: translateY(0) !important;
  box-shadow: none !important;
}

.chatgpt-copy-button {
  font-size: 12px !important;
  padding: 6px 8px !important;
  min-width: auto !important;
  border-radius: 6px !important;
}

.chatgpt-copy-button svg {
  width: 14px !important;
  height: 14px !important;
  opacity: 0.7 !important;
  transition: opacity 0.2s ease !important;
}

.chatgpt-copy-button:hover svg {
  opacity: 1 !important;
}
