/* css/simulator.css - Styles for the Interactive Automation Simulator */

.simulator-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1200px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Panel - Control and Pipeline Board */
.simulator-control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.simulator-lead-form {
  margin-top: 16px;
}

/* Interactive Pipeline Visualization */
.pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding: 10px 0;
}

/* Node connectors using pseudo-elements */
.pipeline-node {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  position: relative;
  z-index: 2;
  transition: all var(--transition-normal);
}

/* Connecting line running through the nodes */
.pipeline-container::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 36px;
  width: 2px;
  height: calc(100% - 72px);
  background: var(--border-glass);
  z-index: 1;
}

/* Glowing active connector line overlay */
.pipeline-connector-glow {
  position: absolute;
  top: 36px;
  left: 36px;
  width: 2px;
  height: 0%;
  background: var(--primary-gradient);
  z-index: 1.5;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transition: height var(--transition-slow);
}

.node-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 2;
  transition: all var(--transition-normal);
}

.node-info {
  flex-grow: 1;
}
.node-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
  transition: color var(--transition-normal);
}
.node-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.node-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Node States */
.pipeline-node.active {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}
.pipeline-node.active .node-icon-wrapper {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}
.pipeline-node.active .node-info h4 {
  color: var(--primary-light);
}

.pipeline-node.completed {
  border-color: rgba(16, 185, 129, 0.4);
}
.pipeline-node.completed .node-icon-wrapper {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}
.pipeline-node.completed .node-status {
  color: var(--success);
}

.pipeline-node.running .node-status {
  color: var(--primary-light);
}

/* Pulsing indicators */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.pipeline-node.running .pulse-dot {
  background: var(--primary-light);
  animation: pulse 1.2s infinite alternate;
}
.pipeline-node.completed .pulse-dot {
  background: var(--success);
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0); }
}

/* Right Panel - Smart Phone Mockup */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 40px;
}

/* iPhone Frame styling */
.phone-mockup {
  width: 320px;
  height: 640px;
  border-radius: 40px;
  background: #000;
  border: 10px solid #222530;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Notch */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 24px;
  background: #000;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}
.phone-notch::before {
  content: '';
  width: 40px;
  height: 4px;
  background: #222;
  border-radius: 2px;
}

/* Status Bar */
.phone-status-bar {
  height: 36px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #fff;
  z-index: 5;
  background: #111;
  font-weight: 600;
  margin-top: 4px;
}
.phone-status-icons {
  display: flex;
  gap: 6px;
}

/* Messaging Screen */
.phone-screen {
  flex-grow: 1;
  background: #0f1016;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-header {
  padding: 16px;
  background: #151722;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}
.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}
.contact-info {
  line-height: 1.2;
}
.contact-name {
  font-size: 0.85rem;
  font-weight: 700;
}
.contact-status {
  font-size: 0.7rem;
  color: var(--success);
}

.phone-messages-body {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sms-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
}
.sms-bubble.incoming {
  background: #202330;
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.sms-bubble.outgoing {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Styled calendly/booking card within message */
.sms-booking-card {
  margin-top: 8px;
  background: #11131e;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sms-booking-card h5 {
  font-size: 0.8rem;
  font-weight: bold;
}
.sms-booking-card p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.sms-booking-btn {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.phone-input-bar {
  padding: 12px 16px;
  background: #151722;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px; /* safe area offset */
}
.phone-input-box {
  flex-grow: 1;
  background: #090a0f;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.phone-send-btn {
  color: var(--primary-light);
  font-size: 1rem;
}

/* Typing bubble */
.typing-bubble {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #202330;
  border-radius: 18px;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* AI Engine prompt review log in simulator dashboard */
.ai-prompt-log {
  margin-top: 24px;
  padding: 16px;
  background: rgba(99, 102, 241, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-md);
}
.ai-prompt-log h5 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-prompt-log pre {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  background: #090a0f;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  max-height: 120px;
  overflow-y: auto;
}
