/**
 * Sistema de Notificações Wini.IA - CSS Principal
 * Implementação conforme Notification-center.md
 * Versão: 1.0.0
 */

/* ===== VARIÁVEIS CSS ===== */
:root {
  /* SUCCESS - Verde Profissional Suavizado */
  --notify-success-bg: linear-gradient(135deg, #F0F9F4 0%, #E8F5EC 100%);
  --notify-success-border: #34A853;
  --notify-success-title: #1E7E34;
  --notify-success-text: #2C3E50;
  --notify-success-icon: #34A853;
  
  /* WARNING - Amarelo/Âmbar Suavizado */
  --notify-warning-bg: linear-gradient(135deg, #FFFBF0 0%, #FFF8E6 100%);
  --notify-warning-border: #F9AB00;
  --notify-warning-title: #CC8800;
  --notify-warning-text: #2C3E50;
  --notify-warning-icon: #F9AB00;
  
  /* ERROR - Vermelho Suavizado */
  --notify-error-bg: linear-gradient(135deg, #FFF4F4 0%, #FFEBEE 100%);
  --notify-error-border: #D93025;
  --notify-error-title: #C5221F;
  --notify-error-text: #2C3E50;
  --notify-error-icon: #D93025;
  
  /* INFO - Azul Suavizado */
  --notify-info-bg: linear-gradient(135deg, #F0F7FF 0%, #E3F2FD 100%);
  --notify-info-border: #1A73E8;
  --notify-info-title: #1967D2;
  --notify-info-text: #2C3E50;
  --notify-info-icon: #1A73E8;
  
  /* NEUTRAL - mantido */
  --notify-neutral-bg: #F3F2F1;
  --notify-neutral-border: #E1DFDD;
  --notify-neutral-text: #323130;
  --notify-neutral-icon: #605E5C;
  
  /* Dimensões */
  --notify-max-width: 480px;
  --notify-min-width: 320px;
  --notify-min-height: 52px;
  --notify-padding: 12px 16px;
  --notify-border-radius: 4px;
  --notify-spacing: 12px;
  
  /* Tipografia */
  --notify-font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
  --notify-font-size-title: 14px;
  --notify-font-size-message: 13px;
  --notify-font-weight-title: 600;
  --notify-font-weight-message: 400;
  
  /* Sombras e elevação */
  --notify-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --notify-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.2);
  
  /* Z-index */
  --notify-z-index: 9999;
}

/* ===== CONTAINER PRINCIPAL ===== */
.notification-center {
  position: fixed;
  z-index: var(--notify-z-index);
  pointer-events: none;
  font-family: var(--notify-font-family);
}

/* Posicionamentos */
.notification-center--top-center {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.notification-center--top-right {
  top: 20px;
  right: 20px;
}

.notification-center--bottom-center {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.notification-center--bottom-right {
  bottom: 20px;
  right: 20px;
}

/* ===== NOTIFICAÇÃO INDIVIDUAL ===== */
.notification-toast {
  position: relative;
  min-width: var(--notify-min-width);
  max-width: var(--notify-max-width);
  min-height: var(--notify-min-height);
  margin-bottom: var(--notify-spacing);
  padding: var(--notify-padding);
  border-radius: var(--notify-border-radius);
  box-shadow: var(--notify-shadow);
  pointer-events: auto;
  cursor: default;
  
  /* Estado inicial para animação */
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s ease;
  
  /* Layout flexível */
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Estados de tipo */
.notification-toast--success {
  background: var(--notify-success-bg);
  border-left: 4px solid var(--notify-success-border);
  color: var(--notify-success-text);
}

.notification-toast--error {
  background: var(--notify-error-bg);
  border-left: 4px solid var(--notify-error-border);
  color: var(--notify-error-text);
}

.notification-toast--warning {
  background: var(--notify-warning-bg);
  border-left: 4px solid var(--notify-warning-border);
  color: var(--notify-warning-text);
}

.notification-toast--info {
  background: var(--notify-info-bg);
  border-left: 4px solid var(--notify-info-border);
  color: var(--notify-info-text);
}

.notification-toast--loading {
  background: var(--notify-info-bg);
  border-left: 4px solid var(--notify-info-border);
  color: var(--notify-info-text);
}

/* Estado importante */
.notification-toast--important {
  border-left-width: 8px;
  box-shadow: var(--notify-shadow-hover);
}

/* Hover effects */
.notification-toast:hover {
  box-shadow: var(--notify-shadow-hover);
  transform: translateY(-2px);
}

/* ===== CONTEÚDO DA NOTIFICAÇÃO ===== */
.notification-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0; /* Permite quebra de texto */
}

.notification-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.notification-icon i {
  font-size: 16px;
}

/* Cores dos ícones por tipo */
.notification-toast--success .notification-icon i {
  color: var(--notify-success-icon);
}

.notification-toast--error .notification-icon i {
  color: var(--notify-error-icon);
}

.notification-toast--warning .notification-icon i {
  color: var(--notify-warning-icon);
}

.notification-toast--info .notification-icon i,
.notification-toast--loading .notification-icon i {
  color: var(--notify-info-icon);
}

/* ===== EMOJI SVG ===== */
.notification-emoji {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.notification-emoji .emoji-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Cores do emoji por tipo */
.notification-toast--success .emoji-icon {
  filter: brightness(0) saturate(100%) 
          invert(41%) sepia(73%) saturate(628%) 
          hue-rotate(91deg) brightness(94%) contrast(89%);
}

.notification-toast--error .emoji-icon {
  filter: brightness(0) saturate(100%) 
          invert(24%) sepia(80%) saturate(2845%) 
          hue-rotate(346deg) brightness(91%) contrast(89%);
}

.notification-toast--warning .emoji-icon {
  filter: brightness(0) saturate(100%) 
          invert(65%) sepia(92%) saturate(1527%) 
          hue-rotate(1deg) brightness(101%) contrast(98%);
}

.notification-toast--info .emoji-icon {
  filter: brightness(0) saturate(100%) 
          invert(35%) sepia(91%) saturate(1780%) 
          hue-rotate(201deg) brightness(95%) contrast(93%);
}

/* ===== CORPO DA NOTIFICAÇÃO ===== */
.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: var(--notify-font-size-title);
  font-weight: var(--notify-font-weight-title);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

/* Cores do título por tipo */
.notification-toast--success .notification-title {
  color: var(--notify-success-title);
}

.notification-toast--error .notification-title {
  color: var(--notify-error-title);
}

.notification-toast--warning .notification-title {
  color: var(--notify-warning-title);
}

.notification-toast--info .notification-title {
  color: var(--notify-info-title);
}

.notification-message {
  font-size: var(--notify-font-size-message);
  font-weight: var(--notify-font-weight-message);
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
}

/* ===== DETALHES ===== */
.notification-details {
  margin: 8px 0 0 0;
  padding: 0;
  list-style: none;
}

.notification-details li {
  font-size: 12px;
  line-height: 1.3;
  margin-bottom: 2px;
  opacity: 0.9;
}

.notification-details li:before {
  content: "•";
  margin-right: 6px;
}

/* ===== BOTÃO DE FECHAR ===== */
.notification-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.notification-close:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

.notification-close i {
  font-size: 12px;
}

/* ===== AÇÕES ===== */
.notification-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.notification-toast .notification-action-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  /* Garantir que não herde estilos conflitantes */
  width: auto !important;
  height: auto !important;
  min-width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-toast .notification-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ===== BARRA DE PROGRESSO ===== */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0 0 var(--notify-border-radius) var(--notify-border-radius);
  overflow: hidden;
}

.notification-progress-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  width: 100%;
  transition: width linear;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .notification-center--top-center,
  .notification-center--top-right {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
  }
  
  .notification-center--bottom-center,
  .notification-center--bottom-right {
    bottom: 10px;
    left: 10px;
    right: 10px;
    transform: none;
  }
  
  .notification-toast {
    max-width: none;
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .notification-toast {
    min-height: 64px;
    padding: 16px;
  }
  
  .notification-title {
    font-size: 15px;
  }
  
  .notification-message {
    font-size: 14px;
  }
}

/* ===== ACESSIBILIDADE ===== */
.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;
}

/* Reduzir movimento para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
  .notification-toast {
    transition: none;
  }
  
  .notification-toast:hover {
    transform: none;
  }
  
  .notification-progress-bar {
    transition: none;
  }
}

/* Alto contraste */
@media (prefers-contrast: high) {
  .notification-toast {
    border: 2px solid currentColor;
  }
  
  .notification-close {
    border: 1px solid currentColor;
  }
}

/* ===== ESTADOS ESPECIAIS ===== */
.notification-toast[data-state="entering"] {
  opacity: 0;
  transform: translateY(-20px);
}

.notification-toast[data-state="entered"] {
  opacity: 1;
  transform: translateY(0);
}

.notification-toast[data-state="exiting"] {
  opacity: 0;
  transform: translateY(-20px);
}

/* ===== UTILITÁRIOS ===== */
.notification-center .notification-toast:last-child {
  margin-bottom: 0;
}

/* Animações customizadas */
.notification-toast.animate-bounce {
  animation: notificationBounce 0.6s ease;
}

.notification-toast.animate-fade {
  animation: notificationFade 0.4s ease;
}

@keyframes notificationBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes notificationFade {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}