/**
 * Senders Management Styles - Premium Redesign
 */

/* Senders Analytics Grid (Top Overview) - EXTRA COMPACT & COLORFUL */
.senders-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.senders-analytics-grid .performance-card {
  padding: 12px 16px;
  border-left: 4px solid var(--border-color);
  background: var(--bg-surface);
}

/* Subtle Card Colors */
.performance-card.daily-usage { border-left-color: #3b82f6; background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(59, 130, 246, 0.03) 100%); }
.performance-card.active-senders { border-left-color: #10b981; background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.03) 100%); }
.performance-card.remaining { border-left-color: #06b6d4; background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(6, 182, 212, 0.03) 100%); }

.senders-analytics-grid .performance-card-value {
  font-size: 18px;
  font-weight: 800;
}

.senders-analytics-grid .performance-card-label {
  font-size: 11px;
}

.senders-analytics-grid .performance-card-icon {
  width: 28px;
  height: 28px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.senders-analytics-grid .performance-card-icon .material-icons {
  font-size: 16px;
  z-index: 2;
}

/* Radial Progress Circle */
.radial-progress-container {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 40px;
  height: 40px;
  z-index: 1;
}

.radial-progress-svg {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.radial-progress-bg {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 3;
}

.radial-progress-bar {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.daily-usage .radial-progress-bar { stroke: #3b82f6; }
.active-senders .radial-progress-bar { stroke: #10b981; }
.remaining .radial-progress-bar { stroke: #06b6d4; }

/* Senders Grid - 3 Columns Layout (Compact) */
.senders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 1200px) {
  .senders-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
  }
}

/* Sender Card - Matches Campaign Card Style (S/M Size) */
.sender-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 220px; /* Force consistent height */
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 4px 8px rgba(0, 0, 0, 0.04);
}

.sender-card:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
}

.sender-card.primary-sender {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.01);
}

.sender-card.inactive {
  opacity: 0.7;
  filter: grayscale(0.3);
}

/* Floating Actions (Top Right) */
.snd-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 3px;
  z-index: 10;
}

.snd-action-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.snd-action-btn:hover {
  background: var(--accent-subtle);
  color: var(--accent-color);
}

.snd-action-btn .material-icons {
  font-size: 14px;
}

/* Sender Header */
.snd-card-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.snd-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.snd-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.snd-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  object-fit: cover;
  background: var(--bg-elevated);
}

.snd-info {
  min-width: 0;
  flex: 1;
}

.snd-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snd-email {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Health Badge (Mini) */
.snd-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: fit-content;
}

.snd-status-healthy {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.snd-status-warning {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.snd-status-error {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.snd-status-inactive {
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.snd-primary-badge {
  background: var(--accent-gradient);
  color: white;
  border: none;
}

/* Stats Row (Compact) */
.snd-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
  padding: 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.snd-stat-item {
  text-align: center;
}

.snd-stat-val {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
}

.snd-stat-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* Quota Progress Bar (Slim) */
.snd-quota-section {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.snd-quota-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  margin-bottom: 4px;
  font-weight: 700;
  color: var(--text-secondary);
}

.snd-progress-track {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.snd-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.snd-progress-bar.low { background: var(--success); }
.snd-progress-bar.medium { background: var(--warning); }
.snd-progress-bar.high { background: var(--error); }

/* Toggle Switch - Mini */
.snd-toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 16px;
}

.snd-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.snd-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .2s;
  border-radius: 16px;
}

.snd-toggle-slider:before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.snd-toggle-switch input:checked + .snd-toggle-slider {
  background: var(--accent-gradient);
}

.snd-toggle-switch input:checked + .snd-toggle-slider:before {
  transform: translateX(16px);
}

/* Dark Mode */
[data-theme="dark"] .snd-toggle-slider {
  background-color: #334155;
}
