/* HSL Variables for Indigo / Violet Dark Theme */
:root {
  --bg: #070613;
  --panel: #0f0b24;
  --panel-light: #181335;
  --border: rgba(99, 102, 241, 0.18);
  --border-active: rgba(99, 102, 241, 0.45);
  --border-glow: rgba(99, 102, 241, 0.25);
  
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --light-purple: #c084fc;
  --red: #f43f5e;
  --green: #10b981;
  --yellow: #f59e0b;
  
  --text: #f3f4f6;
  --text-muted: #8b9bb4;
  --white: #ffffff;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition: all 0.3s ease;
  --shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  padding: 24px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.simulator-wrapper {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.logo {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--light-purple) 0%, var(--indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--light-purple);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--indigo);
  box-shadow: 0 0 10px var(--indigo);
  animation: pulse 2s infinite;
}

/* Grid Layout */
.sim-main-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .sim-main-grid {
    grid-template-columns: 1fr;
  }
}

.sim-col-left, .sim-col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Panel Containers */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.panel-header h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.step-badge {
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--light-purple);
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  background: var(--panel-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.submit-btn {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  border: none;
  border-radius: 8px;
  padding: 12px;
  color: white;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
  transition: var(--transition);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.submit-btn:disabled {
  background: var(--panel-light);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Terminal Styles */
.terminal-panel {
  flex: 1;
  min-height: 200px;
}

.terminal {
  background: #05040e;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 14px;
  flex: 1;
  font-family: monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
}

.clear-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.log-line.system { color: var(--text-muted); }
.log-line.running { color: var(--light-purple); }
.log-line.success { color: var(--green); }
.log-line.warn { color: var(--yellow); }
.log-line.error { color: var(--red); }

/* Scenario Node Map */
.flow-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  position: relative;
}

.flow-node {
  width: 85px;
  background: var(--panel-light);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.flow-node.active {
  border-color: var(--indigo);
  box-shadow: 0 0 15px var(--border-glow);
  transform: scale(1.05);
}

.flow-node.completed {
  border-color: var(--light-purple);
  background: rgba(192, 132, 252, 0.05);
}

.node-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.node-name {
  font-family: var(--font-title);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.node-status {
  font-size: 8px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.flow-node.active .node-status {
  color: var(--light-purple);
}

.flow-node.completed .node-status {
  color: var(--indigo);
}

.flow-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}

.flow-pulse {
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--indigo), var(--light-purple));
  opacity: 0;
  border-radius: 2px;
}

.flow-pulse.animate {
  animation: pulseLine 1.2s forwards;
  opacity: 1;
}

/* Devices Row Layout */
.devices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .devices-row {
    grid-template-columns: 1fr;
  }
}

/* Google Calendar Mock UI */
.calendar-panel {
  display: flex;
  flex-direction: column;
}

.day-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--light-purple);
}

.calendar-view {
  display: grid;
  grid-template-columns: 50px 1fr;
  background: #090818;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  height: 280px;
}

.time-column {
  background: rgba(255, 255, 255, 0.01);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
  text-align: center;
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  position: relative;
}

.grid-slot {
  flex: 1;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

.grid-slot:last-child {
  border-bottom: none;
}

.event-slot {
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.event-color-bar {
  width: 4px;
  background: var(--text-muted);
  transition: var(--transition);
}

.event-details-card {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-details-card h4 {
  font-size: 11px;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
  transition: var(--transition);
}

.event-details-card p {
  font-size: 8px;
  color: var(--text-muted);
}

.card-status-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

/* Color states triggered by routes */
.event-slot.confirmed {
  background: rgba(16, 185, 129, 0.06);
}
.event-slot.confirmed .event-color-bar {
  background: var(--green);
}
.event-slot.confirmed .card-status-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--green);
}

.event-slot.cancelled {
  background: rgba(244, 63, 94, 0.06);
}
.event-slot.cancelled .event-color-bar {
  background: var(--red);
}
.event-slot.cancelled .card-status-badge {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--red);
}

/* Phone Mockup Screen */
.phone-frame {
  width: 100%;
  height: 280px;
  background: #000;
  border: 6px solid #1c182d;
  border-radius: 24px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.phone-screen {
  background: #090818;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.phone-status-bar {
  padding: 4px 10px;
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0,0,0,0.25);
}

.sms-header {
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sms-chat-area {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.sms-empty-note {
  font-size: 8px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 50px;
  font-style: italic;
}

.sms-bubble {
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 9px;
  line-height: 1.4;
  word-wrap: break-word;
  animation: slideIn 0.3s ease;
}

.sms-bubble.incoming {
  background: var(--panel-light);
  border: 1px solid rgba(255,255,255,0.04);
  color: white;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.sms-bubble.outgoing {
  background: var(--indigo);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* SMS Input Area */
.sms-input-area {
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 8px;
  display: flex;
  gap: 6px;
}

.sms-input-area input {
  flex: 1;
  background: var(--panel-light);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 6px 10px;
  color: white;
  font-size: 9px;
  outline: none;
}

.sms-input-area input:disabled {
  background: rgba(0,0,0,0.1);
  color: var(--text-muted);
  border-color: transparent;
}

.sms-send-btn {
  background: var(--indigo);
  border: none;
  border-radius: 12px;
  padding: 0 10px;
  color: white;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 9px;
  cursor: pointer;
  transition: var(--transition);
}

.sms-send-btn:disabled {
  background: var(--panel-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

@keyframes pulseLine {
  0% { width: 0; opacity: 1; }
  100% { width: 100%; opacity: 1; }
}

@keyframes slideIn {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
