/* 
 * Error Message 
 */

.error-message {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  margin: var(--spacing-sm) 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, 
    rgba(239, 68, 68, 0.1) 0%, 
    rgba(220, 38, 38, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-left: 4px solid var(--error);
  box-shadow: var(--shadow-lg);
  animation: slideInError 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.error-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(239, 68, 68, 0.5), 
    transparent);
  animation: shimmer 2s infinite;
}

@keyframes slideInError {
  from { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95);
    filter: blur(4px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Variantes de tipo de error */
.error-network {
  border-left-color: var(--warning);
  border-color: rgba(251, 146, 60, 0.2);
  background: linear-gradient(135deg, 
    rgba(251, 146, 60, 0.1) 0%, 
    rgba(245, 101, 101, 0.05) 100%);
}

.error-timeout {
  border-left-color: var(--warning-light);
  border-color: rgba(252, 211, 77, 0.2);
  background: linear-gradient(135deg, 
    rgba(252, 211, 77, 0.1) 0%, 
    rgba(251, 191, 36, 0.05) 100%);
}

.error-model {
  border-left-color: var(--primary);
  border-color: rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.1) 0%, 
    rgba(79, 70, 229, 0.05) 100%);
}

/* Icono de error*/
.error-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-full);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Contenido error */
.error-content {
  flex: 1;
  min-width: 0;
}

.error-content h3 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--error);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.error-content p {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  opacity: 0.9;
  line-height: 1.5;
}

/* Error tips */
.error-tips {
  margin: var(--spacing-sm) 0 var(--spacing-xs) 0;
  padding-left: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  list-style-type: none;
  position: relative;
}

.error-tips li {
  margin-bottom: var(--spacing-xs);
  position: relative;
  padding-left: var(--spacing-sm);
}

.error-tips li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--error);
  font-weight: bold;
}

/* Botones de accion*/
.error-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-left: var(--spacing-sm);
  flex-shrink: 0;
}

.error-actions button {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  min-width: 80px;
}

.retry-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.retry-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.retry-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.close-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.close-btn:hover {
  background: var(--surface-variant);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Responsive */
@media (max-width: 768px) {
  .error-message {
    flex-direction: column;
    padding: var(--spacing-sm);
  }
  
  .error-actions {
    flex-direction: row;
    margin-left: 0;
    margin-top: var(--spacing-sm);
  }
  
  .error-actions button {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .error-message {
    margin: var(--spacing-xs) 0;
    padding: var(--spacing-sm);
  }
  
  .error-content h3 {
    font-size: var(--font-size-sm);
  }
  
  .error-content p {
    font-size: var(--font-size-xs);
  }
  
  .error-tips {
    font-size: var(--font-size-xs);
  }
  
  .error-actions {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
}

/* Accessibility  */
.error-message:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.error-actions button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .error-message,
  .error-actions button {
    animation: none;
    transition: none;
  }
  
  .error-message::before {
    animation: none;
  }
}

/* Soporte de alto contraste */
@media (prefers-contrast: high) {
  .error-message {
    border-width: 2px;
    background: var(--surface);
  }
  
  .error-content h3,
  .error-icon {
    color: var(--error);
  }
}
