/**
 * Estilos del Sistema de Notificaciones
 * Panel desplegable con campana y notificaciones
 * 
 * @author MemoSoft Team
 * @version 1.0.0
 */

/* ========================================
   CAMPANA DE NOTIFICACIONES
   ======================================== */

/* Contenedor de notificaciones */
.notification-container {
  position: relative;
  display: inline-block;
}

.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: 2px solid var(--brand); /* Naranja de la marca */
  border-radius: 8px;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.notification-bell:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(249, 115, 22, 0.2);
}

.notification-bell:active {
  transform: translateY(0);
}

/* Modo no molestar - gris */
.notification-bell.do-not-disturb {
  border-color: #6b7280;
  color: #6b7280;
}

.notification-bell.do-not-disturb:hover {
  border-color: #4b5563;
  box-shadow: 0 4px 8px rgba(107, 114, 128, 0.2);
}

/* Icono de campana */
.notification-bell svg {
  width: 20px;
  height: 20px;
  fill: var(--brand); /* Naranja de la marca */
  transition: fill 0.3s ease;
}

.notification-bell.do-not-disturb svg {
  fill: #6b7280;
}

/* Badge de contador */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--brand);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  animation: pulse 2s infinite;
}

.notification-badge.hidden {
  display: none;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ========================================
   PANEL DE NOTIFICACIONES
   ======================================== */

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-height: 500px;
  background-color: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  /* Asegurar que el panel no se salga de la pantalla */
  max-width: calc(100vw - 20px);
}

/* Panel visible cuando se hace clic */
.notification-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Header del panel */
.notification-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}

.notification-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.notification-actions {
  display: flex;
  gap: 8px;
}

.notification-action-btn {
  background: var(--bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  /* Asegurar que todo el botón sea clickeable */
  position: relative;
  overflow: visible;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification-action-btn:hover {
  background-color: var(--brand);
  color: white;
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
}

.notification-action-btn.primary {
  background-color: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
}

.notification-action-btn.primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.5);
}

/* Efecto de clic */
.notification-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Asegurar que el SVG ocupe todo el botón */
.notification-action-btn svg {
  width: 100%;
  height: 100%;
  max-width: 24px;
  max-height: 24px;
  pointer-events: none; /* Hacer que el SVG no bloquee los clics */
}

/* Lista de notificaciones */
.notification-list {
  max-height: 350px;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: none;
}

.notification-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light, #f3f4f6);
  transition: background-color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-item:hover {
  background-color: var(--bg-hover);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  background-color: var(--bg-accent);
  border-left: 4px solid var(--brand);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  /* transform: translateY(-50%); */
  width: 8px;
  height: 8px;
  background-color: var(--brand);
  border-radius: 50%;
}

/* Contenido de la notificación */
.notification-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

/* Acciones de la notificación */
.notification-item .notification-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.mark-read-btn {
  background: var(--brand, #f97316);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.mark-read-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}


.notification-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.notification-item-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.notification-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* Estado vacío */
.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.notification-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-empty-icon svg {
  width: 48px;
  height: 48px;
  fill: currentColor;
}

.notification-empty-text {
  font-size: 14px;
  margin: 0;
}

.notification-empty-subtext {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.7;
}

/* Loading */
.notification-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

.notification-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .notification-panel {
    width: 320px;
    right: -10px;
    max-width: calc(100vw - 20px);
  }
  
  .notification-bell {
    width: 36px;
    height: 36px;
  }
  
  .notification-bell svg {
    width: 18px;
    height: 18px;
  }
  
  .notification-badge {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .notification-panel {
    width: 280px;
    right: -20px;
    max-width: calc(100vw - 20px);
  }
  
  .notification-header {
    padding: 12px 16px;
  }
  
  .notification-item {
    padding: 10px 16px;
  }
}

/* ========================================
   ANIMACIONES
   ======================================== */

.notification-item {
  animation: slideIn 0.5s ease-in-out;
}*/

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(120px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-panel.show .notification-item {
  animation: slideIn 0.5s ease-in-out;
} 

/* Efecto de actualización */
.notification-bell.updated {
  animation: updateGlow 1s ease-out;
}

@keyframes updateGlow {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}
