/* ========================================
   AMÉLIORATIONS VISUELLES SUPPLÉMENTAIRES
   ======================================== */

/* ========================================
   BOUTONS AVEC ICÔNES ANIMÉES
   ======================================== */

.btn-icon-animated {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-icon-animated i {
  transition: transform 0.3s ease;
}

.btn-icon-animated:hover i {
  transform: scale(1.2) rotate(5deg);
}

.btn-icon-animated::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-icon-animated:hover::after {
  width: 300px;
  height: 300px;
}

/* ========================================
   CARTES AVEC BORDURE GRADIENT
   ======================================== */

.card-gradient-border {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, #007b5e, #00a884, #667eea);
  animation: gradientRotate 3s linear infinite;
}

.card-gradient-border-content {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
}

[data-theme="dark"] .card-gradient-border-content {
  background: #2c3034;
}

@keyframes gradientRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================
   BADGES FLOTTANTS
   ======================================== */

.floating-badge {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: var(--primary-gradient);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 123, 94, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  animation: slideInLeft 0.5s ease, float 3s ease-in-out infinite;
  z-index: 1000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.floating-badge:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 123, 94, 0.4);
}

.floating-badge i {
  font-size: 1.5rem;
}

@media (max-width: 768px) {
  .floating-badge {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    justify-content: center;
  }
}

/* ========================================
   INDICATEURS DE STATUT
   ======================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.status-indicator.online::before {
  background: #28a745;
  box-shadow: 0 0 10px #28a745;
}

.status-indicator.offline::before {
  background: #dc3545;
  box-shadow: 0 0 10px #dc3545;
}

.status-indicator.away::before {
  background: #ffc107;
  box-shadow: 0 0 10px #ffc107;
}

/* ========================================
   TIMELINE VERTICALE AMÉLIORÉE
   ======================================== */

.timeline-enhanced {
  position: relative;
  padding-left: 3rem;
}

.timeline-enhanced::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
}

.timeline-item-enhanced {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item-enhanced::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.5rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 123, 94, 0.1);
  z-index: 1;
}

.timeline-item-enhanced.completed::before {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.timeline-item-enhanced.completed::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: -2.3rem;
  top: 0.6rem;
  color: white;
  font-size: 0.625rem;
}

/* ========================================
   CARTES STATISTIQUES AVANCÉES
   ======================================== */

.stat-card-advanced {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card-advanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.stat-card-advanced:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.stat-card-advanced .stat-icon-large {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 123, 94, 0.3);
}

.stat-card-advanced .stat-value-large {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-card-advanced .stat-label-large {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.stat-card-advanced .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
}

.stat-card-advanced .stat-change.positive {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.stat-card-advanced .stat-change.negative {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

/* ========================================
   BOUTONS AVEC LOADING STATE
   ======================================== */

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ========================================
   TOOLTIPS PERSONNALISÉS
   ======================================== */

.tooltip-custom {
  position: relative;
  cursor: help;
}

.tooltip-custom::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

.tooltip-custom::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.tooltip-custom:hover::before,
.tooltip-custom:hover::after {
  opacity: 1;
}

/* ========================================
   ALERTES MODERNES
   ======================================== */

.alert-modern {
  border: none;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-modern-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-modern.alert-success {
  background: rgba(40, 167, 69, 0.1);
  color: #155724;
}

.alert-modern.alert-success .alert-modern-icon {
  background: rgba(40, 167, 69, 0.2);
  color: var(--success-color);
}

.alert-modern.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  color: #721c24;
}

.alert-modern.alert-danger .alert-modern-icon {
  background: rgba(220, 53, 69, 0.2);
  color: var(--danger-color);
}

.alert-modern.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
}

.alert-modern.alert-warning .alert-modern-icon {
  background: rgba(255, 193, 7, 0.2);
  color: var(--warning-color);
}

.alert-modern.alert-info {
  background: rgba(23, 162, 184, 0.1);
  color: #0c5460;
}

.alert-modern.alert-info .alert-modern-icon {
  background: rgba(23, 162, 184, 0.2);
  color: var(--info-color);
}

/* ========================================
   CHIPS / TAGS MODERNES
   ======================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--secondary-color);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

.chip-removable {
  cursor: pointer;
}

.chip-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.25rem;
}

.chip-remove:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   ACCORDÉONS MODERNES
   ======================================== */

.accordion-modern .accordion-item {
  border: none;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.accordion-modern .accordion-button {
  background: white;
  border: none;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.accordion-modern .accordion-button:not(.collapsed) {
  background: var(--primary-gradient);
  color: white;
  box-shadow: none;
}

.accordion-modern .accordion-button::after {
  transition: transform 0.3s ease;
}

.accordion-modern .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}

.accordion-modern .accordion-body {
  padding: 1.5rem;
  background: white;
}

/* ========================================
   MODE SOMBRE
   ======================================== */

[data-theme="dark"] .stat-card-advanced,
[data-theme="dark"] .accordion-modern .accordion-button,
[data-theme="dark"] .accordion-modern .accordion-body {
  background: #2c3034;
  color: #f8f9fa;
}

[data-theme="dark"] .chip {
  background: #373b3e;
  color: #f8f9fa;
}

[data-theme="dark"] .alert-modern {
  background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   ANIMATIONS D'ENTRÉE POUR LES LISTES
   ======================================== */

.list-animated > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.list-animated > *:nth-child(1) { animation-delay: 0.1s; }
.list-animated > *:nth-child(2) { animation-delay: 0.2s; }
.list-animated > *:nth-child(3) { animation-delay: 0.3s; }
.list-animated > *:nth-child(4) { animation-delay: 0.4s; }
.list-animated > *:nth-child(5) { animation-delay: 0.5s; }
.list-animated > *:nth-child(n+6) { animation-delay: 0.6s; }

/* ========================================
   SCROLLBAR PERSONNALISÉE
   ======================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--secondary-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #2c3034;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #495057;
}

/* ========================================
   SÉLECTION DE TEXTE PERSONNALISÉE
   ======================================== */

::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}
