/* ==========================================================================
   Slide 2: 1964 ELIZA Mainframe Simulation Styles (Retro Green, Sharp Boxes)
   ========================================================================== */

.decomp-column {
  width: 100%;
  max-width: min(46rem, 92vw);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  z-index: 20;
}

/* 1. Katman: Giriş Alanı & Seçenek Butonları */
.decomp-input-area {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.decomp-meta-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0.15rem;
}

.decomp-meta-title {
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.48);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  user-select: none;
}

.decomp-form {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  padding: 0.35rem 0.45rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.decomp-form:focus-within {
  border-color: #22c55e;
}

.decomp-toggle-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  padding: 0.2rem;
  box-sizing: border-box;
}

.decomp-option-btn {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.55rem 0.7rem;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.decomp-option-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: #111111;
}

.decomp-option-btn.active {
  background: #021a0a;
  border-color: #22c55e;
  color: #22c55e;
  font-weight: 600;
}

.decomp-option-btn.active[data-option="other"] {
  background: #1a0000;
  border-color: #ef4444;
  color: #ef4444;
}

.option-indicator {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.decomp-option-btn.active .option-indicator {
  background: #22c55e;
}

.decomp-option-btn.active[data-option="other"] .option-indicator {
  background: #ef4444;
}

.option-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.decomp-run-btn {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  border-radius: 0;
  padding: 0.55rem 1.05rem;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.decomp-run-btn:hover {
  background: #22c55e;
  color: #000000;
  border-color: #22c55e;
}

.decomp-run-btn:active {
  background: #16a34a;
  color: #000000;
}

@media (max-width: 640px) {
  .decomp-form {
    flex-direction: column;
    align-items: stretch;
  }
  .decomp-toggle-group {
    flex-direction: column;
    align-items: stretch;
  }
  .decomp-run-btn {
    justify-content: center;
  }
}

/* 2. Katman: Animasyon Sahnesi */
.decomp-stage-box {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  height: clamp(12rem, 23vh, 15.5rem);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.decomp-scan-laser {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #22c55e;
  left: -20px;
  opacity: 0;
  pointer-events: none;
  z-index: 25;
}

.decomp-scan-laser.scanning {
  opacity: 1;
  animation: laserScan 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.decomp-scan-laser.error {
  background: #ff4444;
  opacity: 1;
  animation: laserScan 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes laserScan {
  0% { left: 0%; opacity: 0; }
  20% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.stage-display-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Token / Parçalama Kutuları */
.token-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.token-pill {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0;
  color: #ffffff;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  user-select: none;
}

.unified-token {
  padding: 0.8rem 1.6rem;
  font-size: 1.02rem;
  font-weight: 500;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.unified-token.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.token-split-wrap {
  display: none;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
}

.token-split-wrap.active {
  display: flex;
  animation: splitOpen 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splitOpen {
  from { gap: 0.2rem; transform: scale(0.96); opacity: 0.5; }
  to { gap: 1.4rem; transform: scale(1); opacity: 1; }
}

.split-token {
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.token-tag {
  font-size: 0.52rem;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.1em;
}

.token-left {
  border-color: rgba(255, 255, 255, 0.3);
}

.token-right {
  border-color: rgba(255, 255, 255, 0.3);
}

.token-right.matched {
  border-color: #22c55e;
  color: #000000;
  background: #22c55e;
}

.token-right.matched .token-tag {
  color: #000000;
}

.token-right.matched .token-text {
  color: #000000;
  font-weight: 700;
}

/* Şablon & Aynalama Kutusu */
.template-mirror-box {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000000;
  border: 1px dashed #22c55e;
  border-radius: 0;
  padding: 1.1rem 1.8rem;
  position: absolute;
}

.template-mirror-box.active {
  display: flex;
  animation: templateDrop 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes templateDrop {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.template-label {
  font-size: 0.55rem;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-weight: 700;
  color: #22c55e;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
}

.template-phrase {
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 500;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tmpl-slot {
  background: transparent;
  border: 1px solid #22c55e;
  padding: 0.15rem 0.65rem;
  border-radius: 0;
  color: #22c55e;
  font-weight: 600;
  transition: all 0.35s ease;
}

.tmpl-slot.filled {
  background: #22c55e;
  color: #000000;
  font-weight: 700;
}

/* Fallback / Hata Yanıt Kutusu */
.fallback-result-box {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000000;
  border: 1px solid #ff4444;
  border-radius: 0;
  padding: 1.1rem 1.8rem;
  position: absolute;
}

.fallback-result-box.active {
  display: flex;
  animation: fallbackPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fallbackPop {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.fallback-tag {
  font-size: 0.55rem;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-weight: 700;
  color: #ff4444;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
}

.fallback-phrase {
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 400;
  color: #ffffff;
  text-align: center;
}

.shake-anim {
  animation: shake 0.45s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* 3. Katman: Mantık Konsolu */
.decomp-console-box {
  background: #000000;
  border: 1px solid #22c55e;
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  user-select: text;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid rgba(34, 197, 94, 0.25);
  padding-bottom: 0.35rem;
  font-size: 0.55rem;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  color: #22c55e;
  letter-spacing: 0.08em;
}

.console-title {
  color: #22c55e;
  font-weight: 700;
}

.console-status {
  color: #22c55e;
  font-weight: 700;
}

.console-status.active {
  color: #22c55e;
}

.console-status.error {
  color: #ff4444;
}

.console-terminal-lines {
  margin: 0;
  padding: 0;
  font-family: 'SF Mono', 'Courier New', Monaco, Consolas, monospace;
  font-size: clamp(0.72rem, 0.95vw, 0.88rem);
  line-height: 1.6;
  color: #22c55e;
  tab-size: 4;
}

.term-line {
  min-height: 1.55em;
  display: flex;
  align-items: flex-start;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-cursor {
  color: #22c55e;
  font-weight: 700;
  margin-right: 0.4rem;
  user-select: none;
}

.term-text {
  color: #22c55e;
}

@media (max-width: 640px) {
  .decomp-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .decomp-toggle-group {
    flex-direction: column;
    align-items: stretch;
  }
  .decomp-option-btn {
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
  }
  .decomp-run-btn {
    width: 100%;
    justify-content: center;
    padding: 0.55rem;
  }
  .stage-display-wrap {
    min-height: 5.5rem;
  }
  .token-container {
    font-size: 0.85rem;
  }
  .console-terminal-lines {
    font-size: 0.68rem;
  }
}


