/**
 * Estilos para o Sistema de Notificações
 * HOFB - Academia de Jiu-Jitsu
 */

/* Ícone de notificações */
#notification-icon {
  position: relative;
  display: inline-block;
}

#notification-btn {
  border: none;
  background: transparent;
  color: #2c3e50;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 0.375rem;
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#notification-btn:hover {
  color: #1a252f;
  background-color: rgba(44, 62, 80, 0.1);
  transform: scale(1.05);
}

#notification-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
  outline: none;
}

#notification-btn i {
  font-size: 1.1rem;
}

/* Badge de contagem */
#notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.65rem;
  min-width: 20px;
  height: 20px;
  background-color: #e74c3c !important;
  color: white !important;
  font-weight: 700;
  animation: pulse 2s infinite;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-align: center;
  line-height: 1;
  padding: 0;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Dropdown de notificações */
.notification-dropdown {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  padding: 0;
  max-height: 500px;
  overflow: hidden;
}

.notification-dropdown .dropdown-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-dropdown .dropdown-header h6 {
  color: white;
  margin: 0;
  font-size: 1rem;
}

.notification-dropdown .dropdown-footer {
  background-color: #f8f9fa;
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: 0.8rem;
}

/* Lista de notificações */
.notification-list {
  padding: 0;
}

.notification-item {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.notification-item:hover {
  background-color: #f8f9fa;
  border-left-color: #2c3e50;
  transform: translateX(2px);
}

.notification-item:last-child {
  border-bottom: none;
}

/* Título da notificação */
.notification-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6c757d;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

/* Mensagem da notificação */
.notification-message {
  font-size: 0.85rem;
  color: #495057;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

/* Badges de status */
.notification-item .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
  border-radius: 0.375rem;
}

/* Ícones de prioridade */
.notification-item .fas {
  margin-top: 0.1rem;
}

/* Animações */
.notification-item {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Estados de carregamento */
.notification-list .spinner-border {
  width: 1.5rem;
  height: 1.5rem;
}

/* Responsividade */
@media (max-width: 576px) {
  .notification-dropdown {
    min-width: 300px !important;
    max-width: 90vw !important;
  }

  .notification-item {
    padding: 0.75rem !important;
  }

  .notification-title {
    font-size: 0.85rem;
  }

  .notification-message {
    font-size: 0.8rem;
  }

  #notification-btn {
    width: 36px;
    height: 36px;
  }

  #notification-badge {
    font-size: 0.6rem;
    min-width: 18px;
    height: 18px;
    line-height: 1;
    padding: 0;
  }
}

/* Estados vazios */
.notification-list .text-center {
  padding: 2rem 1rem;
}

.notification-list .text-center i {
  opacity: 0.5;
}

/* Botão de atualizar */
#refresh-notifications {
  border: none;
  background: transparent;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

#refresh-notifications:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

#refresh-notifications:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Rotação do ícone de atualizar */
#refresh-notifications.rotating i {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Cores específicas para tipos de notificação */
.notification-item[data-tipo="termo_vencendo"] {
  border-left-color: #f39c12;
  background-color: rgba(243, 156, 18, 0.05);
}

.notification-item[data-tipo="termo_vencido"] {
  border-left-color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.05);
}

.notification-item[data-tipo="atestado_vencendo"] {
  border-left-color: #3498db;
  background-color: rgba(52, 152, 219, 0.05);
}

.notification-item[data-tipo="atestado_vencido"] {
  border-left-color: #e74c3c;
  background-color: rgba(231, 76, 60, 0.05);
}

/* Melhorias de acessibilidade */
.notification-item:focus {
  outline: 2px solid #2c3e50;
  outline-offset: -2px;
}

.notification-item[tabindex="0"] {
  cursor: pointer;
}

/* Melhorias visuais adicionais */
.notification-item {
  border-bottom: 1px solid #e9ecef;
  padding: 1rem;
}

.notification-item:last-child {
  border-bottom: none;
}

/* Melhor contraste para texto */
.notification-item .text-muted {
  color: #6c757d !important;
  font-size: 0.8rem;
}

/* Ícones com melhor contraste */
.notification-item .fas.text-danger {
  color: #e74c3c !important;
}

.notification-item .fas.text-warning {
  color: #f39c12 !important;
}

.notification-item .fas.text-info {
  color: #3498db !important;
}

.notification-item .fas.text-secondary {
  color: #6c757d !important;
}

/* Notificações lidas */
.notification-read {
  opacity: 0.7;
  background-color: rgba(0, 0, 0, 0.02);
}

.notification-read .notification-title {
  color: #6c757d;
  font-weight: 500;
}

.notification-read .notification-message {
  color: #adb5bd;
}

/* Botão "Marcar como lida" */
.mark-as-read-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.mark-as-read-btn:hover {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
  transform: scale(1.05);
}

.mark-as-read-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Badge "Letta" */
.notification-item .badge.bg-success {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

/* Dark mode support (se implementado no futuro) */
@media (prefers-color-scheme: dark) {
  .notification-dropdown {
    background-color: #343a40;
    color: #fff;
  }

  .notification-item:hover {
    background-color: #495057;
  }

  .notification-message {
    color: #adb5bd;
  }

  .notification-dropdown .dropdown-footer {
    background-color: #495057;
    color: #adb5bd;
  }
}
