/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Email Events Horizontal Timeline */
.events-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 16px;
}

.event-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 110px;
}

.event-connector {
  position: absolute;
  top: 24px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #374151 0%, #374151 40%, transparent 40%, transparent 60%, #374151 60%, #374151 100%);
  background-size: 8px 2px;
  z-index: 0;
}

.event-node {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.event-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Event type colors */
.event-node.event-send {
  background: #1f2937;
  border: 2px solid #6b7280;
  color: #9ca3af;
}

.event-node.event-send:hover {
  box-shadow: 0 0 20px rgba(107, 114, 128, 0.4);
}

.event-node.event-delivery {
  background: #064e3b;
  border: 2px solid #10b981;
  color: #10b981;
}

.event-node.event-delivery:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.event-node.event-bounce {
  background: #7f1d1d;
  border: 2px solid #ef4444;
  color: #ef4444;
}

.event-node.event-bounce:hover {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.event-node.event-complaint {
  background: #78350f;
  border: 2px solid #f59e0b;
  color: #f59e0b;
}

.event-node.event-complaint:hover {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.event-node.event-deliverydelay {
  background: #7c2d12;
  border: 2px solid #f97316;
  color: #f97316;
}

.event-node.event-deliverydelay:hover {
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.event-node.event-open {
  background: #164e63;
  border: 2px solid #06b6d4;
  color: #06b6d4;
}

.event-node.event-open:hover {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.event-node.event-click {
  background: #1e3a5f;
  border: 2px solid #3b82f6;
  color: #3b82f6;
}

.event-node.event-click:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.event-node.event-held {
  background: #4a4458;
  border: 2px solid #a78bfa;
  color: #a78bfa;
}

.event-node.event-held:hover {
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.event-node.event-retry {
  background: #1f3a2a;
  border: 2px solid #22c55e;
  color: #22c55e;
}

.event-node.event-retry:hover {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.event-label {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  padding: 4px 12px;
  border-radius: 6px;
  background: transparent;
}

.event-label-delivery {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.event-label-bounce {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.event-label-complaint {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.event-label-deliverydelay {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}

.event-label-open {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
}

.event-label-click {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.event-label-held {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
}

.event-label-retry {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.event-time {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Tooltip styles */
.event-tooltip {
  position: fixed;
  z-index: 9999;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: tooltipFadeIn 0.15s ease;
  pointer-events: auto;
  user-select: text;
  cursor: default;
}

/* Arrow pointing down (tooltip is above trigger) */
.event-tooltip::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #374151;
}

.event-tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1f2937;
}

/* Arrow pointing up (tooltip is below trigger) */
.event-tooltip.tooltip-below::before {
  bottom: auto;
  top: -6px;
  border-top: none;
  border-bottom: 6px solid #374151;
}

.event-tooltip.tooltip-below::after {
  bottom: auto;
  top: -5px;
  border-top: none;
  border-bottom: 5px solid #1f2937;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-tooltip-content {
  color: #e5e7eb;
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tooltip-header strong {
  font-size: 14px;
  color: #fff;
}

.tooltip-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.tooltip-badge-bounce {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.tooltip-badge-complaint {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.tooltip-timestamp {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 10px;
}

.tooltip-detail {
  font-size: 12px;
  color: #d1d5db;
  margin-top: 6px;
  line-height: 1.4;
}

.tooltip-detail strong {
  color: #f3f4f6;
}

.tooltip-recipient {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
  padding-left: 8px;
}

.tooltip-diagnostic {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  font-style: italic;
  word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .email-events-timeline {
    padding: 16px;
  }

  .events-track {
    gap: 0;
  }

  .event-node-wrapper {
    min-width: 80px;
  }

  .event-node {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .event-node svg {
    width: 16px;
    height: 16px;
  }

  .event-label {
    font-size: 11px;
    padding: 3px 8px;
  }

  .event-time {
    font-size: 10px;
  }
}
