/**
 * Estilos adicionales para mejoras implementadas
 * Skip-link, validación de formularios, y componentes mejorados
 */

/* Skip to Main Content Link (Accesibilidad) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #b07a44;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Validación de Formularios */
input.error,
select.error,
textarea.error {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.success-message {
  color: #16a34a;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* Estilos mejorados para inputs con focus */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #b07a44;
  box-shadow: 0 0 0 3px rgba(176, 122, 68, 0.1);
}

/* Indicators de validación */
input[type="email"]:invalid:not(:placeholder-shown),
input[type="tel"]:invalid:not(:placeholder-shown) {
  border-color: #fbbf24;
}

input[type="email"]:valid:not(:placeholder-shown),
input[type="tel"]:valid:not(:placeholder-shown) {
  border-color: #10b981;
}

/* Estilos para imágenes responsive */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

img[loading="lazy"].loaded {
  animation: none;
  background: none;
}

/* Componente de notificación mejorada */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
  z-index: 1000;
  max-width: 400px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  background-color: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.notification.error {
  background-color: #fee2e2;
  border-left: 4px solid #dc2626;
  color: #7f1d1d;
}

.notification.warning {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}

.notification.info {
  background-color: #dbeafe;
  border-left: 4px solid #3b82f6;
  color: #1e3a8a;
}

/* Cerrar notificación */
.notification-close {
  margin-left: 1rem;
  cursor: pointer;
  font-weight: bold;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.notification-close:hover {
  opacity: 1;
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .skip-link,
  input:focus,
  select:focus,
  textarea:focus,
  .notification,
  img[loading="lazy"] {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .notification {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .skip-link {
    font-size: 0.875rem;
    padding: 6px 12px;
  }
}

/* Accesibilidad mejorada */
input:disabled,
select:disabled,
textarea:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Focus visible para navegación con teclado */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #b07a44;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Indicador de estado de carga */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f4f6;
  border-top: 2px solid #b07a44;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Estilos para tabla de responsabilidad */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #1f2937;
}

tr:hover {
  background-color: #f9fafb;
}
