/* Styles personnalisés pour l'application Code Couvrant Ternaire */

/* Variables CSS */
:root {
  --primary-blue: #3b82f6;
  --primary-green: #10b981;
  --primary-purple: #8b5cf6;
  --primary-orange: #f59e0b;
  --primary-red: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Classes utilitaires */
.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Styles pour les matrices */
.matrix-display {
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  background-color: var(--gray-50);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--gray-200);
}

.matrix-row {
  margin-bottom: 0.25rem;
}

.matrix-element {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.125rem;
}

/* Styles pour les vecteurs */
.vector-display {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 0.375rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Styles pour les boutons */
.btn {
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-success {
  background-color: var(--primary-green);
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-purple {
  background-color: var(--primary-purple);
  color: white;
}

.btn-purple:hover {
  background-color: #7c3aed;
}

.btn-warning {
  background-color: var(--primary-orange);
  color: white;
}

.btn-warning:hover {
  background-color: #d97706;
}

.btn-danger {
  background-color: var(--primary-red);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

/* Styles pour les cartes */
.card {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Styles pour les alertes */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
}

.alert-success {
  background-color: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.alert-error {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-warning {
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background-color: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

/* Styles pour les champs de saisie */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

/* Styles pour les badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-error {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Styles pour les tableaux */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background-color: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.table tbody tr:hover {
  background-color: var(--gray-50);
}

/* Styles pour la barre de progression */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background-color: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-blue);
  transition: width 0.3s ease-in-out;
}

/* Styles pour les tooltips */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--gray-900);
  color: white;
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Styles pour les codes mathématiques */
.math-expression {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  background-color: rgba(139, 92, 246, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Styles pour les sections pliables */
.collapsible-header {
  cursor: pointer;
  user-select: none;
  padding: 0.75rem;
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  transition: background-color 0.2s ease-in-out;
}

.collapsible-header:hover {
  background-color: var(--gray-100);
}

.collapsible-content {
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  background-color: white;
}

/* Responsiveness */
@media (max-width: 768px) {
  .card {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .matrix-display {
    font-size: 0.75rem;
    padding: 0.75rem;
  }
  
  .vector-display {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Styles pour l'impression */
@media print {
  .btn, .form-input {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid var(--gray-200);
  }
  
  .alert {
    border: 1px solid;
    background: none !important;
  }
}

/* Styles pour les icônes Font Awesome */
.fas, .far {
  margin-right: 0.375rem;
}

.icon-lg {
  font-size: 1.25rem;
}

.icon-xl {
  font-size: 1.5rem;
}

/* Animations de chargement */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--gray-200);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Styles pour les messages de statut */
.status-message {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.status-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.status-loading {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}