:root {
  --primary-color: #3a7bd5;
  --secondary-color: #00d2ff;
  --dark-color: #1a1a2e;
  --light-color: #f5f5f5;
  --success-color: #00c853;
  --warning-color: #ffab00;
  --danger-color: #ff3d00;
  --info-color: #2979ff;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  transition: all 0.3s ease;
  position: relative;
}

/* Animation de rotation pour l'icône de rafraîchissement */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotating {
  animation: rotate 1s linear infinite;
  display: inline-block;
}

/* Loader global */
.global-loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.global-loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: rotate 1s linear infinite;
}

.global-loader-message {
  margin-top: 20px;
  font-size: 1.2rem;
  color: var(--primary-color);
  text-align: center;
  max-width: 80%;
}

.navbar {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  color: white !important;
}

.card {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 20px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  transition: all 0.3s ease;
}

/* Styles pour la timeline */
.timeline {
  position: relative;
  padding: 20px 0;
  margin-top: 20px;
  list-style: none;
}

.timeline:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color);
  left: 30px;
  margin-left: -1.5px;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding-left: 70px;
}

.timeline-badge {
  position: absolute;
  left: 15px;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timeline-content {
  position: relative;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.timeline-date {
  font-size: 0.85rem;
  color: #777;
  margin-top: 5px;
}

/* Styles pour les badges et statuts */
.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.role-badge i {
  margin-right: 5px;
}

/* Styles pour les alertes d'action requise */
.action-required {
  border-left: 4px solid var(--warning-color);
  background-color: rgba(255, 171, 0, 0.1);
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 171, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 171, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 171, 0, 0);
  }
}

/* Styles pour l'affichage des adresses */
.address-display {
  background-color: #f5f5f5;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
  border: 1px solid #ddd;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(58, 123, 213, 0.3);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
  border-radius: 6px;
  padding: 8px 16px;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(58, 123, 213, 0.3);
}

.transaction-card {
  position: relative;
  overflow: hidden;
}

.transaction-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.status-badge {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pending {
  background-color: #fff8e1;
  color: #ffa000;
}

.status-active {
  background-color: #e3f2fd;
  color: #1976d2;
}

.status-completed {
  background-color: #e8f5e9;
  color: #388e3c;
}

.status-dispute {
  background-color: #ffebee;
  color: #d32f2f;
}

.status-archived {
  background-color: #eeeeee;
  color: #757575;
}

.timeline {
  position: relative;
  padding-left: 30px;
  margin-bottom: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15px;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-item {
  position: relative;
  padding-bottom: 15px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-content {
  padding: 10px 15px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.timeline-date {
  font-size: 0.8rem;
  color: #757575;
}

.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

.tab-content {
  padding-top: 20px;
}

.nav-tabs .nav-link {
  border: none;
  color: #757575;
  font-weight: 600;
  padding: 10px 15px;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
  border: none;
  color: var(--primary-color);
  position: relative;
}

.nav-tabs .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 3px 3px 0 0;
}

.form-control {
  border-radius: 6px;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(58, 123, 213, 0.25);
}

.form-label {
  font-weight: 600;
  color: #555;
}

.address-display {
  font-family: monospace;
  background-color: #f5f5f5;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  word-break: break-all;
  display: inline-block;
  margin-left: 24px;
}

.address-display.w-100 {
  width: calc(100% - 24px);
}

.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 5px;
}

.role-emitter {
  background-color: #e3f2fd;
  color: #1976d2;
}

.role-receiver {
  background-color: #e8f5e9;
  color: #388e3c;
}

.role-resolver {
  background-color: #fff8e1;
  color: #ffa000;
}

.transaction-detail-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.transaction-detail-header h2 {
  margin: 0;
  font-weight: 700;
}

.transaction-detail-header p {
  margin: 5px 0 0;
  opacity: 0.8;
}

.validation-status {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.validation-item {
  text-align: center;
  padding: 15px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  flex: 1;
  margin: 0 5px;
}

.validation-item i {
  font-size: 24px;
  margin-bottom: 10px;
}

.validation-item.validated i {
  color: var(--success-color);
}

.validation-item.pending i {
  color: var(--warning-color);
}

.validation-item.rejected i {
  color: var(--danger-color);
}

.validation-item .validation-time {
  font-size: 0.8rem;
  color: #757575;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.action-buttons .btn {
  flex: 1;
  min-width: 120px;
}

.modal-xl {
  max-width: 1140px;
}

.transaction-details .modal-dialog {
  max-width: 800px;
}

.transaction-details .participant-item {
  margin-bottom: 15px;
}

.transaction-details .participant-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.transaction-details .participant-header i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 16px;
  color: var(--primary-color);
}

.transaction-details .participant-label {
  font-weight: bold;
  margin-right: 5px;
}

#metamaskStatus {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

#metamaskStatus.connected {
  background-color: #e8f5e9;
  color: #388e3c;
}

#metamaskStatus.disconnected {
  background-color: #ffebee;
  color: #d32f2f;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
}

/* Style pour les boutons du footer de la modale de détails de transaction */
#transactionDetailModal .modal-footer button {
  /* Tous les boutons ont exactement la même taille */
  min-width: 100px;
  max-width: 100px;
  padding: 6px 12px;
  margin: 0 5px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.5;
  border-radius: 4px;
}

/* Réinitialiser les styles spécifiques des boutons d'action pour qu'ils correspondent au bouton Fermer */
#transactionDetailModal .action-buttons button {
  background-image: none;
  box-shadow: none;
  transform: none;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#transactionDetailModal .action-buttons button:hover {
  transform: none;
  box-shadow: none;
}

#transactionDetailModal .action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#transactionDetailModal .close-button {
  display: flex;
  align-items: center;
}

.custom-toast {
  min-width: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.custom-toast .toast-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
}

.custom-toast .toast-body {
  padding: 15px;
}

.history-item {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.history-item:hover {
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.history-item-rejected {
  background-color: #fff8f8;
  border-left: 4px solid var(--danger-color);
}

.history-item-rejected .history-action {
  color: var(--danger-color);
  font-weight: bold;
}
