/* ProFireManager v2.0 - Styles CSS personnalisés */

/* Variables CSS pour la cohérence des couleurs */
:root {
  --primary-red: #dc2626;
  --primary-red-hover: #b91c1c;
  --primary-red-light: #fef2f2;
  --secondary-blue: #2563eb;
  --secondary-blue-hover: #1d4ed8;
  --success-green: #16a34a;
  --warning-yellow: #ca8a04;
  --danger-red: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* Animations et transitions fluides */
* {
  transition: all 0.2s ease-in-out;
}

/* Amélioration de l'accessibilité */
:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

/* Styles pour les notifications toast */
.toast {
  animation: slideIn 0.3s ease-out;
}

.toast.leaving {
  animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Amélioration des boutons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-hover) 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--secondary-blue-hover) 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

/* Cards avec effets d'ombre améliorés */
.card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

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

/* Indicateurs de statut avec animations */
.status-indicator {
  position: relative;
  display: inline-block;
}

.status-indicator.active::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background-color: var(--success-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

/* Amélioration des tableaux responsive */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px;
  }
}

/* Loading spinners */
.loading-spinner {
  border: 3px solid var(--gray-200);
  border-top: 3px solid var(--primary-red);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

/* Badge de formations avec couleurs spécifiques */
.formation-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}

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

.formation-badge.secours {
  background-color: #dcfce7;
  color: #166534;
}

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

.formation-badge.officier {
  background-color: #f3e8ff;
  color: #7c3aed;
}

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

/* Calendrier personnalisé */
.calendar-day {
  min-height: 120px;
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background-color: var(--gray-50);
  border-color: var(--primary-red);
}

.calendar-day.today {
  background-color: var(--primary-red-light);
  border-color: var(--primary-red);
}

.calendar-day.has-shifts {
  background-color: #eff6ff;
}

/* Shift indicators */
.shift-indicator {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  margin-bottom: 1px;
  display: block;
}

.shift-indicator.jour {
  background-color: #fef3c7;
  color: #92400e;
}

.shift-indicator.nuit {
  background-color: #e0e7ff;
  color: #3730a3;
}

.shift-indicator.weekend {
  background-color: #f0fdf4;
  color: #166534;
}

/* Sidebar navigation améliorée */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::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;
}

.nav-link:hover::before {
  left: 100%;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .mobile-card {
    margin: 0.5rem;
    border-radius: 0.75rem;
  }
  
  .mobile-padding {
    padding: 1rem;
  }
  
  .mobile-text-sm {
    font-size: 0.875rem;
  }
}

/* Dark mode support (préparation future) */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-900: #f9fafb;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-full-width {
    width: 100% !important;
  }
  
  .page-break {
    page-break-before: always;
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-red);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--gray-800);
  }
  
  .btn-primary {
    border: 2px solid var(--gray-900);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

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

/* Progressive Web App styles */
.install-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-red);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.install-prompt.show {
  transform: translateY(0);
  opacity: 1;
}

/* Custom form elements */
.custom-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 3px;
  background: white;
  position: relative;
  cursor: pointer;
}

.custom-checkbox:checked {
  background: var(--primary-red);
  border-color: var(--primary-red);
}

.custom-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--primary-red);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  z-index: 1000;
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
}

/* Responsive utilities */
@media (max-width: 640px) {
  .sm\:hidden {
    display: none;
  }
}

@media (max-width: 768px) {
  .md\:hidden {
    display: none;
  }
}

@media (max-width: 1024px) {
  .lg\:hidden {
    display: none;
  }
}