/*
 * SPDX-License-Identifier: BSD-3-Clause
 * SPDX-FileCopyrightText: Copyright (c) 2026 OpenBlink.org
 */

/* WebSimulator Panel Styles */

.simulator-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  background: #252526;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid #3c3c3c;
  z-index: 1000;
  overflow: hidden;
}

.simulator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #333333;
  color: #cccccc;
  border-bottom: 1px solid #3c3c3c;
}

.simulator-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.simulator-close-btn {
  padding: 4px 12px;
  background: #3c3c3c;
  color: #cccccc;
  border: 1px solid #5a5a5a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.15s;
}

.simulator-close-btn:hover {
  background: #4a4a4a;
}

.simulator-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  background: #2d2d2d;
  border-bottom: 1px solid #3c3c3c;
  color: #cccccc;
  font-size: 12px;
}

.simulator-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc;
}

.simulator-status-indicator.loading {
  background-color: #f0ad4e;
  animation: simulator-pulse 1s infinite;
}

.simulator-status-indicator.ready {
  background-color: #5cb85c;
}

.simulator-status-indicator.error {
  background-color: #d9534f;
}

.simulator-status-indicator.running {
  background-color: #5bc0de;
  animation: simulator-pulse 0.5s infinite;
}

@keyframes simulator-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.simulator-board-ui {
  padding: 15px;
  background: #1e1e1e;
  border-bottom: 1px solid #3c3c3c;
  min-height: 100px;
}

.simulator-board-title {
  font-size: 12px;
  font-weight: 500;
  color: #cccccc;
  margin-bottom: 12px;
}

.simulator-console {
  padding: 0;
}

.simulator-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: #333333;
  color: #cccccc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.simulator-clear-btn {
  padding: 3px 10px;
  background: #3c3c3c;
  color: #cccccc;
  border: 1px solid #5a5a5a;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}

.simulator-clear-btn:hover {
  background: #4a4a4a;
}

.simulator-output {
  background-color: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  padding: 12px;
  min-height: 120px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.simulator-output .error {
  color: #f48771;
}

.simulator-output .info {
  color: #569cd6;
}

.simulator-output .success {
  color: #6a9955;
}

/* Simulator LED Matrix Styles */

.simulator-dot-container {
  display: grid;
  grid-template-rows: repeat(6, 30px);
  grid-template-columns: repeat(10, 30px);
  gap: 0;
  direction: rtl;
  grid-auto-flow: column;
  width: fit-content;
  border: 1px solid #3c3c3c;
  background-color: #2d2d2d;
  margin: 0 auto;
}

.simulator-dot {
  width: 30px;
  height: 30px;
  background-color: #444444;
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #858585;
  transition: background-color 0.1s;
}

/* Overlay backdrop */
.simulator-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

/* Run Simulator button styles */
#run-simulator {
  background-color: #17a2b8;
  color: white;
}

#run-simulator:hover:not(:disabled) {
  background-color: #138496;
}

#run-simulator:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
