/* Canvas Workspace and Virtual Screen Styling */
.canvas-workspace {
  flex: 1;
  background-color: var(--bg-primary);
  background-image: linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.canvas-preview-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: auto;
  padding: 60px 20px 20px 20px;
}

.canvas-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.canvas-wrapper {
  background-color: #060911;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.08);
  position: relative;
}

/* 320x240 @ 2x zoom = 640x480 */
#tft-canvas {
  width: 640px;
  height: 480px;
  background-color: #000000;
  position: relative;
  overflow: hidden;
  user-select: none;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
}

/* Grid overlay background using linear-gradients */
/* Each grid square is 8px * 2 (zoom) = 16px */
#tft-canvas.grid-visible {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Canvas Welcome/Active State Marker */
.canvas-welcome {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-muted);
  pointer-events: none;
  font-family: var(--font-family);
}

.canvas-welcome p {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.canvas-welcome span {
  font-size: 11px;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Canvas status metadata row */
.canvas-status-bar {
  display: flex;
  justify-content: space-between;
  width: 680px; /* 640 + padding borders */
  padding: 0 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Predefined page notice container outside canvas */
.predefined-page-notice {
  width: 680px;
  background-color: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--text-secondary, #cbd5e1);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.predefined-page-notice strong {
  color: var(--text-primary, #ffffff);
}

/* Firmware 5-Page Navigation Scroll Bar Representation */
.firmware-page-scroll-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px 0;
  width: 100%;
}

.firmware-page-scroll-bar .scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--border-color, rgba(255, 255, 255, 0.2));
  transition: all 0.2s ease;
}

.firmware-page-scroll-bar .scroll-dot.active {
  width: 24px;
  border-radius: 4px;
  background-color: var(--accent, #00E5FF);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}
