/**
 * Styles pour l'Assistant IA
 */

/* Bouton d'assistance IA */
.ai-assistant-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}

.ai-assistant-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.ai-assistant-btn:hover::before {
  left: 100%;
}

.ai-assistant-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.ai-assistant-btn:active {
  transform: translateY(0);
}

.ai-assistant-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-assistant-btn.unavailable {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: none;
  opacity: 0.7;
}

.ai-assistant-btn.unavailable:hover {
  transform: none;
  box-shadow: none;
}

.ai-assistant-btn.unavailable::before {
  display: none;
}

.ai-assistant-btn .icon {
  font-size: 18px;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Modal de suggestions */
.ai-suggestions-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-suggestions-modal.active {
  opacity: 1;
}

.ai-suggestions-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ai-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.ai-suggestions-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.ai-suggestions-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.ai-suggestions-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ai-suggestions-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.suggestions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.suggestion-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #10b981;
}

.suggestion-item-full {
  grid-column: 1 / -1;
}

.suggestion-demo {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.suggestion-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.suggestion-value {
  font-size: 14px;
  color: #111827;
  font-weight: 500;
}

.suggestion-value .tag {
  display: inline-block;
  padding: 4px 10px;
  background: #10b981;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.ai-suggestions-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 16px 16px;
}

.ai-suggestions-footer button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-suggestions-reject {
  background: #e5e7eb;
  color: #374151;
}

.ai-suggestions-reject:hover {
  background: #d1d5db;
}

.ai-suggestions-accept {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ai-suggestions-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Responsive */
@media (max-width: 640px) {
  .suggestions-grid {
    grid-template-columns: 1fr;
  }
  
  .ai-suggestions-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .ai-suggestions-header {
    padding: 16px 20px;
  }
  
  .ai-suggestions-header h3 {
    font-size: 18px;
  }
  
  .ai-suggestions-body {
    padding: 20px;
  }
  
  .ai-suggestions-footer {
    flex-direction: column;
    padding: 16px 20px;
  }
}

/* Loader avec barre de progression */
.ai-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease;
}

.ai-loader-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.ai-loader-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: sparkleRotate 2s ease-in-out infinite;
}

@keyframes sparkleRotate {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(10deg);
  }
  50% {
    transform: scale(1) rotate(0deg);
  }
  75% {
    transform: scale(1.1) rotate(-10deg);
  }
}

.ai-loader-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.ai-loader-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

.ai-loader-model {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}

.ai-progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ai-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 50%, #10b981 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: progressShine 2s ease-in-out infinite;
  width: 0%;
  transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes progressShine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.ai-loader-tip {
  margin-top: 16px;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}
