/* Améliorations d'accessibilité */

/* Focus visible pour navigation clavier */
*:focus {
  outline: 2px solid var(--jpx-red-primary);
  outline-offset: 2px;
}

/* Skip link pour navigation clavier */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--jpx-black-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
  border-radius: 4px;
}

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

/* Amélioration des contrastes */
.has-text-grey-dark {
  color: #363636 !important;
}

.has-text-grey-light {
  color: #b5b5b5 !important;
}

/* Boutons accessibles */
.button:focus {
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.3);
}

/* Liens accessibles */
a:focus {
  color: var(--jpx-red-primary);
  text-decoration: underline;
}

/* Formulaires accessibles */
.input:focus,
.textarea:focus,
.select select:focus {
  border-color: var(--jpx-red-primary);
  box-shadow: 0 0 0 0.125em rgba(196, 30, 58, 0.25);
}

/* Labels obligatoires */
.label.required::after {
  content: " *";
  color: var(--jpx-red-primary);
}

/* Messages d'erreur accessibles */
.help.is-danger {
  color: #ff3860;
  font-weight: 500;
}

/* Navigation accessible */
.navbar-item:focus,
.navbar-link:focus {
  background-color: rgba(196, 30, 58, 0.1);
  color: var(--jpx-red-primary);
}

/* Amélioration des cartes pour lecteurs d'écran */
.card {
  position: relative;
}

.card[role="article"] {
  cursor: pointer;
}

/* Texte pour lecteurs d'écran uniquement */
.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;
}

/* Amélioration des modales */
.modal.is-active {
  z-index: 9999;
}

.modal-card {
  max-height: calc(100vh - 40px);
}

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

.table th,
.table td {
  white-space: nowrap;
}

/* Amélioration de la lisibilité */
.content {
  line-height: 1.6;
}

.content p {
  margin-bottom: 1em;
}

/* Améliorations pour les images */
img {
  max-width: 100%;
  height: auto;
}

.image img {
  object-fit: cover;
}

/* Navigation responsive améliorée */
@media screen and (max-width: 1023px) {
  .navbar-menu {
    background-color: white;
    box-shadow: 0 8px 16px rgba(10, 10, 10, 0.1);
  }
  
  .navbar-item {
    padding: 1rem;
    border-bottom: 1px solid #f5f5f5;
  }
}

/* Amélioration des notifications */
.notification {
  position: relative;
  padding-right: 3rem;
}

.notification .delete {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

/* Amélioration des tooltips */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--jpx-black-primary);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 0.875rem;
}

/* Amélioration des états de chargement */
.is-loading {
  position: relative;
  overflow: hidden;
}

.is-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-color-scheme: dark) {
  .auto-dark {
    background-color: #1a1a1a;
    color: #f5f5f5;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .button {
    border: 2px solid;
  }
  
  .card {
    border: 1px solid #363636;
  }
}

/* Amélioration des formulaires en cas d'erreur */
.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select select {
  border-color: #ff3860;
}

.field.has-error .label {
  color: #ff3860;
}