/* Campaign Monitor – Real-time Control Center */

.control-toolbar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  padding: 20px;
  flex-wrap: wrap;
}

.control-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.monitor-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.monitor-campaign-name {
  font-weight: 600;
  font-size: 1.1rem;
  flex: 1;
}

.ws-indicator {
  font-size: 12px;
  color: var(--text-muted);
}

.ws-indicator.connected {
  color: var(--accent-green);
}

.monitor-stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.monitor-timer-card,
.monitor-current-card,
.monitor-rate-card {
  padding: 20px;
}

.monitor-timer-card h3,
.monitor-current-card h3,
.monitor-rate-card h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timer-display {
  font-size: 2.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-blue);
  margin-bottom: 16px;
  animation: pulse-timer 2s ease-in-out infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.timer-meta {
  display: grid;
  gap: 8px;
}

.timer-meta .label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.timer-meta span:last-child {
  font-weight: 500;
}

.current-email-panel .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}

.rate-limit-row {
  margin-bottom: 12px;
}

.rate-limit-row .rate-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.rate-limit-row .rate-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-bar-lg {
  height: 14px;
  border-radius: 7px;
}

.progress-bar-fill.animated {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
}

.progress-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.activity-feed {
  max-height: 240px;
  overflow-y: auto;
  padding: 12px 20px 20px;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.activity-item .event-type {
  font-weight: 600;
  color: var(--accent-purple);
  min-width: 140px;
}

.activity-item .event-time {
  color: var(--text-muted);
  font-size: 11px;
}

.queue-table-wrap {
  overflow-x: auto;
  padding: 0;
}

.queue-row-drag {
  cursor: grab;
}

.queue-row-drag.sortable-ghost {
  opacity: 0.4;
  background: var(--accent-blue);
}

.queue-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.queue-actions .btn {
  padding: 2px 6px;
  font-size: 11px;
}

.queue-pagination {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-warning {
  background: rgba(251, 146, 60, 0.2);
  color: var(--accent-orange);
  border: 1px solid rgba(251, 146, 60, 0.4);
}

.btn-warning:hover {
  background: rgba(251, 146, 60, 0.35);
}

.badge-stopped {
  background: rgba(248, 113, 113, 0.2);
  color: var(--accent-red);
}

.badge-cancelled {
  background: rgba(136, 136, 170, 0.2);
  color: var(--text-secondary);
}

.badge-sending {
  background: rgba(79, 142, 247, 0.2);
  color: var(--accent-blue);
  animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.muted {
  color: var(--text-muted);
}

.monitor-stat-mini {
  padding: 14px;
  text-align: center;
}

.monitor-stat-mini .val {
  font-size: 1.4rem;
  font-weight: 700;
}

.monitor-stat-mini .lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

[data-theme="light"] .timer-display {
  color: #2563eb;
}
