/* ========================================================
   ALERT SYSTEM STYLES
   ======================================================== */

/* Alert Bell Button */
.alert-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.alert-bell:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.alert-bell svg {
  width: 20px;
  height: 20px;
}

.alert-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  border: 2px solid var(--bg-primary);
}

.alert-badge.empty {
  display: none;
}

/* Alert Dropdown */
.alert-dropdown {
  position: absolute;
  top: 60px;
  right: 20px;
  width: 400px;
  max-height: 600px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-2xl);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.alert-dropdown.show {
  display: flex;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.alert-dropdown-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.alert-dropdown-actions {
  display: flex;
  gap: 8px;
}

.alert-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.alert-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

.alert-list {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
}

.alert-list::-webkit-scrollbar {
  width: 8px;
}

.alert-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.alert-list::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 4px;
}

.alert-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Alert Card */
.alert-card {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.alert-card:last-child {
  border-bottom: none;
}

.alert-card:hover {
  background: var(--bg-hover);
}

.alert-severity-indicator {
  width: 4px;
  min-width: 4px;
  border-radius: 2px;
  margin-right: 4px;
}

.alert-severity-indicator.critical {
  background: var(--danger);
}

.alert-severity-indicator.warning {
  background: var(--warning);
}

.alert-severity-indicator.info {
  background: var(--info);
}

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

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

.alert-asset-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.alert-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.alert-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.alert-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.alert-actions-inline {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.alert-btn-small {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.alert-btn-small:hover {
  background: var(--bg-hover);
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

.alert-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.alert-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.alert-empty-text {
  font-size: 14px;
}

/* Alert Severity Badges */
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.severity-badge.critical {
  background: var(--danger-light);
  color: var(--danger);
}

.severity-badge.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.severity-badge.info {
  background: var(--info-light);
  color: var(--info);
}

/* Toast Notifications */
.alert-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  z-index: 10000;
  animation: slideInRight 0.3s ease;
  overflow: hidden;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.alert-toast-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.alert-toast-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.alert-toast-indicator.critical {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.alert-toast-indicator.warning {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.alert-toast-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.alert-toast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.alert-toast-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.alert-toast-body {
  padding: 16px;
}

.alert-toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.alert-toast-actions {
  display: flex;
  gap: 8px;
}

.alert-toast-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-primary);
}

.alert-toast-btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.alert-toast-btn-primary:hover {
  background: var(--primary-hover);
}

.alert-toast-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
}

.alert-toast-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
