/* ChotuBot Virtual Simulator Stylesheet */

#simulator {
  background: var(--paper-warm);
  border-top: 1px solid var(--card-line);
  border-bottom: 1px solid var(--card-line);
  padding: clamp(60px, 8vw, 120px) clamp(20px, 5vw, 52px);
  position: relative;
  overflow: hidden;
}

.simulator-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.simulator-head {
  text-align: center;
  margin-bottom: 50px;
}

.simulator-head h2 {
  font-family: var(--font);
  font-weight: 200;
  letter-spacing: -0.05em;
  line-height: 0.96;
  font-size: clamp(34px, 5.2vw, 72px);
  margin-top: 10px;
}

.simulator-head h2 em {
  font-style: normal;
  font-weight: 400;
  color: var(--orange);
}

/* Three-column layout grid */
.sim-grid {
  display: grid;
  grid-template-columns: 350px 1fr 350px;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .sim-grid {
    grid-template-columns: 1fr 1fr;
  }
  .sim-center-col {
    grid-column: span 2;
    order: -1;
  }
}

@media (max-width: 768px) {
  .sim-grid {
    grid-template-columns: 1fr;
  }
  .sim-center-col {
    grid-column: span 1;
  }
}

/* Dashboard Cards */
.sim-card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s;
}

.sim-card:hover {
  box-shadow: var(--card-shadow-lg);
}

.sim-card.executing {
  border-color: var(--orange);
  box-shadow: 0 0 16px rgba(255, 85, 0, 0.2), var(--card-shadow);
}

.sim-card-title {
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(26, 22, 18, 0.06);
  padding-bottom: 10px;
}

/* Connection Info Row */
.connection-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
}

.sim-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: #ccc;
  transition: background-color 0.3s;
}

.sim-status-dot.connected {
  background: #4FA67A;
  box-shadow: 0 0 8px rgba(79, 166, 122, 0.6);
}

.sim-status-dot.offline {
  background: #E05D5D;
}

/* Log Stream */
.log-stream {
  flex-grow: 1;
  min-height: 180px;
  max-height: 240px;
  background: #1e1b18;
  border-radius: 16px;
  padding: 14px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: #c9c0b7;
  line-height: 1.6;
  border: 1px solid rgba(255, 85, 0, 0.15);
}

.log-entry {
  margin-bottom: 8px;
  word-break: break-all;
  white-space: pre-wrap;
}

.log-entry.info { color: #88b0eb; }
.log-entry.success { color: #88ebad; }
.log-entry.warning { color: #ebd488; }
.log-entry.error { color: #eb8888; }

/* Interactive Visualizer and Mic Control */
.audio-hub {
  background: var(--card-line);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#audioVisualizer {
  width: 100%;
  height: 60px;
  border-radius: 10px;
  background: rgba(26,22,18,0.03);
}

/* Chat box in sidebar */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-input-wrapper {
  position: relative;
  display: flex;
}

.chat-input-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-line);
  font-family: var(--font);
  font-size: 14px;
  background: var(--paper-warm);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.chat-input-wrapper input:focus {
  border-color: var(--orange);
  background: #fff;
}

.chat-send-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--ink-muted);
  transition: color 0.2s;
}

.chat-send-icon:hover {
  color: var(--orange);
}

/* Control buttons style override */
.btn-round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}

.btn-round:hover {
  transform: scale(1.05);
  background: var(--ink-soft);
}

.btn-round.recording {
  background: var(--orange);
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0% { box-shadow: 0 0 0 0 rgba(255, 85, 0, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 85, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 85, 0, 0); }
}

.btn-round:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Center Desk Column */
.sim-center-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 20px;
}

/* Dynamic Ambient Glow */
.ambient-glow {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: var(--orange);
  filter: blur(100px);
  opacity: 0.15;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: background-color 0.8s ease, opacity 0.8s ease;
  pointer-events: none;
  z-index: 1;
}

/* ChotuBot Body & Display Screen Wrapper */
.chotubot-device-frame {
  width: 260px;
  height: 260px;
  background: linear-gradient(135deg, #fbfaf8 0%, #e2dacd 100%);
  border-radius: 64px;
  border: 1px solid rgba(26,22,18,0.1);
  box-shadow: 0 12px 36px rgba(80,50,20,0.12), 0 28px 64px -14px rgba(80,50,20,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}

/* Screen Display */
.chotubot-screen {
  width: 170px;
  height: 170px;
  background: #100f0d;
  border-radius: 44px;
  border: 8px solid #23201c;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

/* Expressive Vector Face Styles */
.robot-face-svg {
  width: 130px;
  height: 130px;
  display: block;
}

.eye {
  fill: var(--orange);
  transition: fill 0.5s ease, transform 0.2s ease, d 0.3s ease;
}

.mouth {
  stroke: var(--orange);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  transition: stroke 0.5s ease, d 0.3s ease;
}

.eyebrow {
  stroke: var(--orange);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
  transition: stroke 0.5s ease, transform 0.3s ease, d 0.3s ease;
}

/* Breathing & Blinking Face Animations */
@keyframes eye-blink {
  0%, 95%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.1); }
}

.chotubot-screen.sleeping .eye {
  animation: none;
}

.chotubot-screen.listening .eye {
  animation: eye-pulsate 1.5s ease-in-out infinite;
}

@keyframes eye-pulsate {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--orange)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px var(--orange)); }
}

/* Mood Chip Indicators */
.mood-chips-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 2;
  margin-top: 10px;
}

.mood-chip-btn {
  border: 1px solid var(--card-line);
  background: var(--card);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mood-chip-btn:hover {
  border-color: var(--orange-soft);
  color: var(--ink);
}

.mood-chip-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Right Panel: Smart Sandbox */

/* Smart Light Controller */
.light-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.light-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.light-bulb-svg {
  width: 44px;
  height: 44px;
  transition: fill 0.3s, filter 0.3s;
}

.light-bulb-svg.off {
  fill: #8a837c;
  filter: none;
}

.light-bulb-svg.on {
  fill: var(--orange);
  filter: drop-shadow(0 0 12px var(--orange));
}

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

.slider-group label {
  font-family: var(--font);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
}

.slider-input {
  width: 100%;
  accent-color: var(--orange);
  cursor: pointer;
}

.color-palette {
  display: flex;
  gap: 8px;
}

.color-dot-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.color-dot-btn:hover {
  transform: scale(1.15);
}

.color-dot-btn.active {
  border-color: var(--ink);
}

/* 3D Printer Progress Card */
.printer-status-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(26,22,18,0.03);
  border-radius: 16px;
  padding: 16px;
}

.printer-icon-svg {
  width: 50px;
  height: 50px;
  fill: var(--ink-muted);
}

.printer-icon-svg.printing {
  fill: var(--orange);
  animation: printing-shake 0.5s ease-in-out infinite;
}

@keyframes printing-shake {
  0%, 100% { transform: translateY(0); }
  25% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, 1px); }
}

.printer-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.printer-file-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.printer-state-tag {
  font-family: var(--font);
  font-size: 11px;
  color: var(--ink-muted);
}

.progress-bar-wrapper {
  background: var(--card-line);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--orange);
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* Virtual Notepad Board */
.notes-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.sticky-note {
  background: #fdf5d3;
  border-left: 5px solid #e2cb69;
  border-radius: 4px;
  padding: 12px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: #4a4023;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
  transition: transform 0.15s;
}

.sticky-note:hover {
  transform: rotate(-0.5deg) scale(1.02);
}

.sticky-note-time {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(74,64,35,0.6);
  margin-top: 6px;
  text-align: right;
}

.notes-empty-state {
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  padding: 20px;
  border: 1px dashed var(--card-line);
  border-radius: 12px;
}

/* Modal Popup Settings Overlay */
.sim-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26,22,18,0.5);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sim-modal-content {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 28px;
  box-shadow: var(--card-shadow-lg);
  max-width: 520px;
  width: 100%;
  padding: 32px;
  position: relative;
}

.sim-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(26,22,18,0.06);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.sim-modal-title {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 600;
}

.sim-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-muted);
  transition: color 0.15s;
}

.sim-modal-close:hover {
  color: var(--ink);
}

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

.form-group label {
  font-family: var(--font);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}

.form-group input, .form-group select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-line);
  background: var(--paper-warm);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--orange);
  background: #fff;
}

/* Settings tab controls */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-line);
  gap: 12px;
  margin-bottom: 20px;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.15s;
  border-radius: 0;
}

.settings-tab-btn:hover {
  color: var(--ink);
}

.settings-tab-btn.active {
  border-bottom: 2px solid var(--orange);
  color: var(--ink);
  font-weight: 600;
}

.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
}

.sim-btn-group {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Camera Stream Frame */
.sim-camera-container {
  display: none;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.sim-camera-container.active {
  display: block;
}

#simCameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror */
}

.camera-overlay-text {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
}
