/* Interactive Developer Terminal — CRT style */
.term-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.term-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.term-container {
  width: 90%;
  max-width: 800px;
  height: 80vh;
  max-height: 600px;
  background: #020202;
  border: 1.5px solid #00ff66;
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.25), inset 0 0 10px rgba(0, 255, 102, 0.15);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Space Grotesk', 'Courier New', Courier, monospace;
  color: #00ff66;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.term-modal.is-open .term-container {
  transform: scale(1);
}

/* Terminal Header */
.term-header {
  background: #001f0a;
  border-bottom: 1.5px solid #00ff66;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.term-title {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
}

.term-close {
  background: transparent;
  border: none;
  color: #00ff66;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.term-close:hover {
  color: #fff;
}

/* Terminal Body */
.term-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Scanlines overlay on terminal */
.term-crt-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 10;
}

/* Output lines */
.term-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.term-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.term-prompt {
  font-weight: 700;
  user-select: none;
}

.term-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  padding: 0;
}

/* Custom terminal scrollbar */
.term-body::-webkit-scrollbar {
  width: 6px;
}
.term-body::-webkit-scrollbar-track {
  background: transparent;
}
.term-body::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 102, 0.2);
  border-radius: 3px;
}
.term-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 102, 0.4);
}

/* ANSI & Highlight styles */
.text-cyan { color: #00ffff; }
.text-yellow { color: #ffff00; }
.text-dim { color: rgba(0, 255, 102, 0.5); }
.text-white { color: #ffffff; }

/* Pulse animation for prompt cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.term-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #00ff66;
  animation: blink 1s infinite;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .term-container {
    width: 95%;
    height: 85vh;
    max-height: none;
    border-radius: 4px;
  }

  .term-body {
    padding: 14px;
    font-size: 0.8rem;
  }

  .term-header {
    padding: 6px 12px;
  }
}
