/* Variables */
:root {
  --primary-color: #c80000;
  --secondary-color: #2c2e43;
  --success-color: #4bb543;
  --warning-color: #f9c74f;
  --danger-color: #ef476f;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --light-gray: #e9ecef;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

/* Base Styles */
.equipements-container {
  max-width: 1200px;
  margin: 0 auto;
  /* padding: 2rem; */
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--dark-color);
  line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark-color);
}

h1 {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
  margin: 0;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
  text-align: center;
  padding: 1.5rem;
  background: var(--secondary-color);
  border-radius: var(--border-radius);
  /* border-left: 4px solid var(--primary-color); */
}

.page-header h1 {
  margin: 0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  margin: 0.5rem 0 0;
  opacity: 0.9;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

/* Alert */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background-color: #e8f4fd;
  border: 1px solid #b8daff;
  color: #004085;
  animation: fadeIn 0.3s ease;
}

.alert i {
  font-size: 1.25rem;
  margin-top: 0.2rem;
  color: #0d6efd;
}

.alert strong {
  font-weight: 600;
}

.alert p {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Card */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #e9ecef;
  animation: fadeIn 0.3s ease;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: start;
  /* flex-wrap: wrap; */
  gap: 1rem;
}

.card-body {
  padding: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  gap: 0.5rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn i {
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Search Box */
.search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 400px;
}

.equipements-body .search-box .input-icon {
  position: relative !important;
  /* width: 50%; */
  /* right: 0; */
}

.search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid #ced4da;
  border-radius: 50px;
  transition: var(--transition);
  font-size: 0.9rem;
  height: 38px;
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
  outline: none;
}

.search-box i {
  position: absolute;
  z-index: 9000000;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-color);
  font-size: 0.9rem;
}

/* Equipements Grid */
.equipements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Equipement Card */
.equipement-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.3s ease;
}

.equipement-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.equipement-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f9fa;
}

.equipement-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.equipement-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #dee2e6;
  color: var(--gray-color);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.btn-icon:hover {
  background-color: #f8f9fa;
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-icon:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn-icon i {
  color: white;
}
.btn-danger {
  color: var(--danger-color);
  border-color: #f5c6cb;
}

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

.equipement-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.equipement-body h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--dark-color);
  font-weight: 600;
}

.equipement-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #f0f0f0;
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  font-weight: 500;
  color: var(--gray-color);
}
.card-actions {
  display: flex;
  justify-content: space-between;
}
.card-header .card-actions {
}
.card-header h3 {
  margin: 0 0 0.25rem 0;
  font-size: 20px;
  color: var(--secondary-color) !important;
}

.header-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: transparent !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  margin-right: 5px;
}

.header-icon i {
  font-size: 1.25rem;
  color: var(--primary-color);
}

.card-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-color);
}
.detail-value {
  color: var(--dark-color);
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
  .equipements-grid {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .search-box {
    width: 100%;
    max-width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .equipement-card {
    max-width: 100%;
  }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

#equipementModal .modal-content {
  background: white;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 600px;
  max-height: -webkit-fill-available;
  transform: none !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease;
}

#equipementModal .equipement-list {
}

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

#equipementModal .modal-header {
  border-bottom: none !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 !important;
}

#equipementModal .modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#equipementModal .close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-color);
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--danger-color);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
  outline: none;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

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

.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
}

/* Loading State */
.loading-equipements {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--gray-color);
  text-align: center;
  background: #f8f9fa;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  animation: fadeIn 0.3s ease;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(67, 97, 238, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-color);
  animation: fadeIn 0.3s ease;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #e9ecef;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.empty-state p {
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* modal creation*/
/* Styles pour les equiepement */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.piece-item {
  transition: all 0.3s ease;
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
}

.piece-item h5 {
  margin-top: 0;
  color: #2c3e50;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.piece-item .form-group {
  margin-bottom: 15px;
}

.piece-item .form-group:last-child {
  margin-bottom: 0;
}

/* Styles généraux */
.equipements-container {
  padding: 0 !important;
  max-width: 1200px;
  margin: 0 auto;
}

/* Styles des cartes */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  background: #f9fafb;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.card-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #2d3748;
}

.card-subtitle {
  margin: 5px 0 0;
  color: #718096;
  font-size: 0.9rem;
}

/* Boutons */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: #4f46e5;
  color: white;
}

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-icon {
  padding: 8px 12px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #4f46e5;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #e0e7ff;
  transform: translateY(-2px);
}

/* Tableau */
.table-responsive {
  overflow-x: auto;
}

.interventions-table {
  width: 100%;
  border-collapse: collapse;
}

.interventions-table th,
.interventions-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.interventions-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.interventions-table tr:hover {
  background: #f8fafc;
}

/* Barre de recherche */
.search-box {
  position: relative;
  width: 300px;
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-box input {
  width: 100%;
  padding: 10px 15px 10px 45px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.search-box input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  outline: none;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

#EquipementForm .modal-body {
  padding: 0;
  max-height: 100vh;
  overflow: auto;
}

#EquipementForm .form-group select {
  padding: 4px 12px !important;
}

#EquipementForm .form-group input {
  padding: 3px 15px !important;
}

#EquipementForm .modal-content {
  background: white;
  margin: 5% auto;
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

#EquipementForm .modal.show .modal-content {
  transform: translateY(0);
}

#EquipementForm .modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#EquipementForm .modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #2d3748;
}

#EquipementForm .close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

#EquipementForm .close-modal:hover {
  color: #4f46e5;
}

#EquipementForm .form-group {
  margin-bottom: 20px;
}

#EquipementForm .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #4a5568;
}

#EquipementForm .form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.3s;
}

#EquipementForm .form-control:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  outline: none;
}

#EquipementForm .modal-footer {
  padding: 15px 25px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .search-box {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

/* Styles pour les toasts */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 300px;
  z-index: 1100;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-header {
  padding: 12px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toast-header strong {
  font-size: 0.9rem;
}

.close-toast {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
}

.toast-body {
  padding: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Couleurs des toasts par type */
.toast-success {
  border-left: 4px solid #28a745;
}

.toast-error {
  border-left: 4px solid #dc3545;
}

.toast-warning {
  border-left: 4px solid #ffc107;
}

.toast-info {
  border-left: 4px solid #17a2b8;
}

/* Animation d'entrée */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Animation de sortie */
@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Style pour les boutons d'action dans le tableau */
.btn-edit,
.btn-delete {
  background: none;
  border: none;
  color: #4f46e5;
  cursor: pointer;
  padding: 5px;
  margin: 0 3px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-edit:hover,
.btn-delete:hover {
  background: rgba(79, 70, 229, 0.1);
}

.btn-delete {
  color: #ef4444;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Style pour les lignes du tableau cliquables */
.intervention-item {
  cursor: pointer;
  transition: background-color 0.2s;
}

.intervention-item:hover {
  background-color: #f8fafc !important;
}
