/* Bouton AI */
.ai-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ai-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.ai-button:active {
  transform: translateY(0);
}

/* Container résultat AI */
.ai-result {
  margin-top: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-left: 4px solid #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.15);
}

.ai-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: #667eea;
  margin-bottom: 12px;
}

.ai-result ul {
  margin: 0;
  padding-left: 20px;
}

.ai-result li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* État de chargement */
.ai-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #667eea;
}

.ai-loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* État d'erreur */
.ai-error {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  color: #dc2626;
}

#ai-summary {
  margin: 24px 0;
}

/* Rate limit */
.ai-rate-limit {
  margin-top: 16px;
  padding: 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
  border-left: 4px solid #f59e0b;
  text-align: center;
}

.ai-rate-limit-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.ai-rate-limit-title {
  font-size: 18px;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 8px;
}

.ai-rate-limit-message {
  color: #92400e;
  line-height: 1.6;
}

/* ============================================
   THEME COLORS - Match AI Button
   ============================================ */

:root {
  --ai-gradient-start: #667eea;
  --ai-gradient-end: #764ba2;
}

/* Light mode */
[data-md-color-scheme="default"] {
  --md-primary-fg-color: #667eea;
  --md-primary-fg-color--light: #8b9cf0;
  --md-primary-fg-color--dark: #5a6fd6;
  --md-accent-fg-color: #764ba2;
  --md-typeset-a-color: #667eea;
}

/* Dark mode */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #667eea;
  --md-primary-fg-color--light: #8b9cf0;
  --md-primary-fg-color--dark: #5a6fd6;
  --md-accent-fg-color: #764ba2;
  --md-typeset-a-color: #8b9cf0;
}

/* Header gradient */
.md-header {
  background: linear-gradient(135deg, var(--ai-gradient-start) 0%, var(--ai-gradient-end) 100%);
}

/* Tabs actifs */
.md-tabs__link--active,
.md-nav__link--active {
  color: #667eea !important;
}

/* Boutons et éléments interactifs */
.md-search__input:focus {
  border-color: #667eea;
}

/* Code inline */
.md-typeset code {
  background-color: rgba(102, 126, 234, 0.1);
}

/* Blockquotes */
.md-typeset blockquote {
  border-left-color: #667eea;
}

/* Tables header */
.md-typeset table:not([class]) th {
  background-color: rgba(102, 126, 234, 0.1);
}

/* Progress bar (si utilisé) */
.md-progress__bar {
  background: linear-gradient(135deg, var(--ai-gradient-start) 0%, var(--ai-gradient-end) 100%);
}

/* Selection text */
::selection {
  background-color: rgba(102, 126, 234, 0.3);
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--ai-gradient-start) 0%, var(--ai-gradient-end) 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ai-gradient-end);
}

/* Titre du site en blanc (light mode) */
[data-md-color-scheme="default"] .md-header__title {
  color: white !important;
}

[data-md-color-scheme="default"] .md-header__topic {
  color: white !important;
}

/* Logo plus grand dans le header */
.md-header__button.md-logo {
  padding: 0;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: 3rem;   /* Ajuste cette valeur (défaut: 1.2rem) */
  height: 3rem;
}