/**
 * GLPI Control Center - notifications.css
 * -----------------------------------------------------------------------------
 * Estilos para o sistema de notificações inteligentes.
 *
 * Sprint 10: Central de Notificações Inteligentes
 */

/* ==========================================================================
   1) BADGE NO TOPBAR
   ========================================================================== */

.notif-bell-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface, #1a1d27);
  animation: notif-badge-pulse 2s infinite;
}

@keyframes notif-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ==========================================================================
   2) PAINEL LATERAL
   ========================================================================== */

#notifications-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--surface, #1a1d27);
  border-left: 1px solid var(--border, #2e3347);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

#notifications-panel.open {
  right: 0;
}

/* ==========================================================================
   3) HEADER DO PAINEL
   ========================================================================== */

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2e3347);
  flex-shrink: 0;
}

.notif-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #e8eaf6);
}

.notif-panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notif-action-btn {
  background: none;
  border: 1px solid var(--border, #2e3347);
  color: var(--text2, #9299b8);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.notif-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #e8eaf6);
}

.notif-action-btn.notif-action-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.notif-close-btn {
  background: none;
  border: none;
  color: var(--text2, #9299b8);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.notif-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text, #e8eaf6);
}

/* ==========================================================================
   4) BUSCA
   ========================================================================== */

.notif-panel-search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border, #2e3347);
  position: relative;
  flex-shrink: 0;
}

.notif-search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text3, #6b7280);
  pointer-events: none;
}

.notif-search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg, #0f1117);
  border: 1px solid var(--border, #2e3347);
  border-radius: 8px;
  color: var(--text, #e8eaf6);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.notif-search-input:focus {
  border-color: var(--accent, #4f7ef7);
}

.notif-search-input::placeholder {
  color: var(--text3, #6b7280);
}

.notif-search-clear {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3, #6b7280);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.notif-search-clear:hover {
  color: var(--text, #e8eaf6);
}

/* ==========================================================================
   5) FILTROS
   ========================================================================== */

.notif-panel-filters {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border, #2e3347);
  overflow-x: auto;
  flex-shrink: 0;
}

.notif-filter-btn {
  background: none;
  border: 1px solid var(--border, #2e3347);
  color: var(--text2, #9299b8);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.notif-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #e8eaf6);
}

.notif-filter-btn.active {
  background: var(--accent, #4f7ef7);
  color: #fff;
  border-color: var(--accent, #4f7ef7);
}

/* ==========================================================================
   6) LISTA DE NOTIFICAÇÕES
   ========================================================================== */

.notif-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.notif-panel-list::-webkit-scrollbar {
  width: 6px;
}

.notif-panel-list::-webkit-scrollbar-track {
  background: transparent;
}

.notif-panel-list::-webkit-scrollbar-thumb {
  background: var(--border, #2e3347);
  border-radius: 3px;
}

/* ==========================================================================
   7) GRUPOS
   ========================================================================== */

.notif-group {
  margin-bottom: 8px;
}

.notif-group-header {
  padding: 10px 20px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   8) ITEM DE NOTIFICAÇÃO
   ========================================================================== */

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
  cursor: default;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
  background: rgba(79, 126, 247, 0.05);
}

.notif-item.unread:hover {
  background: rgba(79, 126, 247, 0.08);
}

.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e8eaf6);
  line-height: 1.3;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text3, #6b7280);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-item-message {
  font-size: 12px;
  color: var(--text2, #9299b8);
  margin: 0 0 6px;
  line-height: 1.4;
}

.notif-item-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text3, #6b7280);
}

.notif-item-priority {
  font-weight: 600;
}

.notif-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.notif-item-btn {
  background: none;
  border: 1px solid var(--border, #2e3347);
  color: var(--text2, #9299b8);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.notif-item-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text, #e8eaf6);
}

.notif-item-btn-primary {
  background: rgba(79, 126, 247, 0.1);
  border-color: rgba(79, 126, 247, 0.3);
  color: var(--accent, #4f7ef7);
}

.notif-item-btn-primary:hover {
  background: rgba(79, 126, 247, 0.2);
}

.notif-item-btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   9) ESTADO VAZIO
   ========================================================================== */

.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3, #6b7280);
  font-size: 14px;
}

/* ==========================================================================
   10) FOOTER
   ========================================================================== */

.notif-panel-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border, #2e3347);
  font-size: 11px;
  color: var(--text3, #6b7280);
  flex-shrink: 0;
}

/* ==========================================================================
   11) WIDGET DO DASHBOARD
   ========================================================================== */

.notif-widget {
  background: var(--surface, #1a1d27);
  border: 1px solid var(--border, #2e3347);
  border-radius: 12px;
  overflow: hidden;
}

.notif-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2e3347);
}

.notif-widget-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e8eaf6);
}

.notif-widget-more {
  background: none;
  border: none;
  color: var(--accent, #4f7ef7);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.notif-widget-more:hover {
  background: rgba(79, 126, 247, 0.1);
}

.notif-widget-list {
  max-height: 300px;
  overflow-y: auto;
}

.notif-widget-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.notif-widget-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notif-widget-item.unread {
  background: rgba(79, 126, 247, 0.05);
}

.notif-widget-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.notif-widget-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}

.notif-widget-title {
  font-size: 13px;
  color: var(--text, #e8eaf6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-widget-time {
  font-size: 11px;
  color: var(--text3, #6b7280);
  flex-shrink: 0;
  margin-left: 12px;
}

.notif-widget-empty {
  text-align: center;
  padding: 24px 20px;
  color: var(--text3, #6b7280);
  font-size: 13px;
  margin: 0;
}

/* ==========================================================================
   12) ANIMAÇÕES
   ========================================================================== */

@keyframes notif-slide-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes notif-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.notif-item {
  animation: notif-slide-in 0.2s ease;
}

/* ==========================================================================
   13) RESPONSIVIDADE
   ========================================================================== */

@media (max-width: 768px) {
  #notifications-panel {
    width: 100%;
    right: -100%;
  }

  .notif-panel-header {
    padding: 14px 16px;
  }

  .notif-panel-search {
    padding: 10px 16px;
  }

  .notif-panel-filters {
    padding: 10px 16px;
  }

  .notif-item {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  #notifications-panel {
    width: 100%;
  }

  .notif-panel-actions {
    gap: 4px;
  }

  .notif-action-btn {
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* ==========================================================================
   14) ACESSIBILIDADE
   ========================================================================== */

.notif-item:focus-visible,
.notif-filter-btn:focus-visible,
.notif-item-btn:focus-visible,
.notif-action-btn:focus-visible,
.notif-close-btn:focus-visible {
  outline: 2px solid var(--accent, #4f7ef7);
  outline-offset: 2px;
}

/* Respeitar prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .notif-item,
  .notif-badge,
  #notifications-panel {
    animation: none !important;
    transition: none !important;
  }
}
