/* IBM 1053 Console Printer Styles */
/* 13" paper width, 130 characters per line, 15.5 CPS Selectric */

.printer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
  border-radius: 12px;
  outline: none;
}

.printer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.printer-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #e0e0f0;
  font-family: 'Courier New', monospace;
  margin: 0;
}

.printer-info {
  display: flex;
  gap: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

.paper-info,
.char-info,
.cps-info {
  color: #48bb78;
  font-weight: bold;
}

/* Paper Container - 13" IBM fanfold paper */
.paper-container {
  background: #888;
  padding: 8px;
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow-x: auto;
}

/* Greenbar Paper - 130 characters per line */
/* Printer behavior: paper feeds from bottom, new lines appear at bottom */
.greenbar {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0px,
    #fff 22.4px,
    #e8f5e8 22.4px,
    #e8f5e8 44.8px
  );
  padding: 16px 20px;
  height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 4px;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.2);
  color: #000;
  /* Printer scrolls content - use flex to push content to bottom */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 100%;
}

.greenbar .spacer {
  /* Spacer fills remaining space above content, pushing output to bottom */
  flex: 1;
  min-height: 2em;
}

.greenbar .output {
  white-space: pre;
  flex-shrink: 0;
}

.greenbar .line {
  min-height: 1.5em;
  white-space: pre;
}

.greenbar .line.current {
  background: rgba(72, 187, 120, 0.15);
}

/* Blinking cursor */
.cursor {
  animation: blink 0.5s step-end infinite;
  color: #333;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Controls */
.printer-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

.start-button {
  padding: 0.75rem 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  background: linear-gradient(135deg, #38a169 0%, #276749 100%);
  border: 2px solid #276749;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.start-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.4);
}

.start-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: linear-gradient(135deg, #666 0%, #444 100%);
  border-color: #444;
}

.line-count {
  color: #9ca3af;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .printer-header {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .greenbar {
    font-size: 10px;
    padding: 10px;
    min-height: 300px;
  }

  .printer-controls {
    flex-direction: column;
  }

  .start-button {
    width: 100%;
  }
}
