/* Spinner */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

/* Toast message styles */
.toast {
  background: #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 14px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 420px;
}
.toast .toast-content {
  flex: 1;
  line-height: 1.4;
}
.toast .toast-content a {
  color: #fff;
  text-decoration: underline;
}
.toast .toast-dismiss {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  padding: 0 0 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.toast .toast-dismiss:hover {
  opacity: 1;
}

/* Color types */
.toast.success {
  background: #4caf50;
}

.toast.error {
  background: #f44336;
}

.toast.info {
  background: #2196f3;
}

.toast.warning {
  background: #ffc107 !important;
  color: #664d03;
}
.toast.warning .toast-dismiss {
  color: #664d03;
}
.toast.warning .toast-content a {
  color: #664d03;
}

/* Spinner animation for running toast */
@keyframes bg-task-spin {
  to { transform: rotate(360deg); }
}

/* Notification toast inner structure */
.notif-toast-header {
  margin-bottom: 4px;
}

.notif-toast-message {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 8px;
  line-height: 1.3;
}

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

.notif-toast-ack,
.notif-toast-snooze,
.notif-toast-delete {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.15s ease;
}

.notif-toast-ack:hover,
.notif-toast-snooze:hover,
.notif-toast-delete:hover {
  background: rgba(255, 255, 255, 0.35);
}

.notif-toast-snooze,
.notif-toast-delete {
  opacity: 0.8;
}

table p {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 110% !important;
}

/* Allow text wrapping in link columns (long product names etc) */
/* Override Django's .nowrap class on the main link column (th in tbody for editable lists) */
#result_list tbody th.nowrap,
#result_list tbody td.nowrap:has(a[href*="/change"]) {
  white-space: normal !important;
  word-wrap: break-word;
  max-width: 400px;
}

#result_list tbody th.nowrap a,
#result_list tbody td.nowrap a[href*="/change"] {
  white-space: normal !important;
  word-wrap: break-word;
}
