/* Presenter Control Center Styling */
:root {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: #1f293d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 24px;
}

.controller-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.controller-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controller-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge-live {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-live .pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #22c55e;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.telemetry-summary {
  display: flex;
  align-items: center;
  gap: 20px;
}

.telemetry-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.telemetry-stat .label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.telemetry-stat .value {
  font-size: 18px;
  font-family: monospace;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Presets */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.preset-btn {
  background: #1a2234;
  border: 1px solid #2b3850;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-btn:hover {
  background: #222d44;
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.preset-btn.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.preset-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.preset-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Chaos Trigger Buttons */
.chaos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chaos-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chaos-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.chaos-btn:active {
  transform: translateY(1px);
}

.chaos-btn.red {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border-color: #ef4444;
}

.chaos-btn.amber {
  background: linear-gradient(135deg, #78350f, #92400e);
  border-color: #f59e0b;
}

.chaos-btn.purple {
  background: linear-gradient(135deg, #4c1d95, #5b21b6);
  border-color: #8b5cf6;
}

.chaos-btn.blue {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border-color: #3b82f6;
}

/* Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.slider-val {
  font-family: monospace;
  font-weight: 700;
  color: var(--accent-cyan);
}

input[type=range] {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
  cursor: pointer;
}

/* Switches */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.switch-label {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 13px;
  font-weight: 500;
}

.switch-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-cyan);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* Victim Live Action Feed */
.feed-box {
  background: #0d131f;
  border: 1px solid #1a2333;
  border-radius: 8px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-item {
  display: flex;
  gap: 8px;
  line-height: 1.4;
  color: #94a3b8;
}

.feed-time {
  color: #64748b;
}

.feed-msg.spike {
  color: #ef4444;
  font-weight: bold;
}

.feed-msg.action {
  color: #38bdf8;
}

.feed-msg.preset {
  color: #f59e0b;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Target Workstation Selector & Machine Pills */
.machine-selector-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.75));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.machine-selector-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selector-icon-badge {
  font-size: 24px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 10px;
  border-radius: 8px;
}

.selector-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #38bdf8;
}

.selector-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

.machine-selector-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dropdown-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.machine-dropdown {
  background: #0f172a;
  border: 1px solid #0284c7;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  min-width: 280px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.machine-dropdown:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.target-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 12px;
  border-radius: 9999px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.green {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.status-dot.amber {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.btn-clear-offline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-clear-offline:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.btn-clear-offline.has-offline {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fee2e2;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.machine-pills-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.machine-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.machine-pill:hover {
  background: #334155;
  border-color: #0284c7;
  color: #fff;
}

.machine-pill.active {
  background: #0369a1;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  font-weight: 700;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.pill-dot.offline {
  background: #ef4444;
}

.pill-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 6px;
  border-radius: 9999px;
  font-family: monospace;
}

.feed-machine-tag {
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
}

@media (max-width: 860px) {
  .machine-selector-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .machine-selector-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .machine-dropdown {
    width: 100%;
    min-width: 0;
  }
}
