/* ==========================================================================
   Slide 5: Sentetik Zekâ ve İnsani Sınır (Görünüm Değiştirici / X-Ray)
   Koyu Minimalist Mimarisi & Donanım Hızlandırmalı Geçişler
   ========================================================================== */

/* Merkez Sütun Kapsayıcı (max-width: 620px) */
.xray-card-wrapper {
  width: 100%;
  max-width: min(38.75rem, 92vw);
  margin: auto;
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ana Minimal Kart */
.xray-card {
  width: 100%;
  background: rgba(22, 25, 31, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid #262a34;
  border-radius: 1.25rem;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0;
  box-sizing: border-box;
}

/* 1. Katman: Üst Başlık */
.xray-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  margin-bottom: 0.35rem;
}

.xray-badge {
  display: inline-block;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: none;
  letter-spacing: 0.08em;
}

.xray-main-title {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.25;
}

/* 2. Katman: Orta Ekran Alanı (Display Viewport) */
.xray-screen-area {
  position: relative;
  background: #0e1117;
  border: 1px solid rgba(38, 42, 52, 0.95);
  border-radius: 0.85rem;
  min-height: 11.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.45);
}

/* Katmanlar: İnsan vs Matris */
.xray-view-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1.25rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.97);
  filter: blur(4px);
  transition: 
    opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.45s;
  pointer-events: none;
}

.xray-view-layer.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  filter: blur(0);
  pointer-events: auto;
}

/* İnsan Katmanı Tipografisi */
.layer-human .xray-sentence {
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  font-weight: 500;
  color: #f8fafc;
  line-height: 1.45;
  letter-spacing: -0.015em;
  margin: 0 0 1rem 0;
  max-width: 28rem;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.12);
  transition: color 0.3s ease;
}

.xray-perception-tag {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  backdrop-filter: blur(8px);
}

/* Yapay Zekâ Matris Katmanı */
.layer-matrix .matrix-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: clamp(0.78rem, 1.4vw, 0.96rem);
  line-height: 1.35;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.matrix-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.matrix-bracket {
  color: #64748b;
  font-weight: 600;
}

.matrix-val {
  display: inline-block;
  min-width: 4.2ch;
  text-align: right;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.matrix-val.pos {
  color: #38bdf8; /* Terminal cyan */
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.matrix-val.neg {
  color: #10b981; /* Canlı zümrüt yeşil */
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

/* Aktif Ağırlık Nabzı (Weight computation pulse) */
.matrix-val.pulse {
  animation: weightComputePulse 1.8s infinite alternate ease-in-out;
}

@keyframes weightComputePulse {
  0% { opacity: 0.75; transform: scale(0.99); }
  100% { opacity: 1; transform: scale(1.02); text-shadow: 0 0 12px currentColor; }
}

.xray-reality-tag {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.75rem;
  font-weight: 400;
  color: #38bdf8;
  letter-spacing: 0.04em;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

/* Glitch / Scramble Efekt Katmanı */
.xray-glitch-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.95rem;
  color: #38bdf8;
  letter-spacing: 0.12em;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(14, 17, 23, 0.88);
  backdrop-filter: blur(3px);
  z-index: 5;
  transition: opacity 0.15s ease;
}

.xray-glitch-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 3. Katman: Etkileşim Butonu (3 ve 4 ile Eşit Tasarım, Google Spotlight) */
.xray-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1.25rem;
}

.xray-toggle-btn {
  position: relative;
  background: #232731;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans, 'Google Sans Flex', -apple-system, sans-serif);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  box-shadow: none;
  transform: none;
  transition: background-color 0.25s ease, border-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

.xray-toggle-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1.5px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image: 
    linear-gradient(#282d38, #282d38),
    radial-gradient(
      85px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 1) 0%,
      rgba(56, 189, 248, 1) 25%,
      rgba(168, 85, 247, 0.9) 55%,
      rgba(236, 72, 153, 0.6) 80%,
      rgba(255, 255, 255, 0.14) 100%
    );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1;
}

.xray-toggle-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    70px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(56, 189, 248, 0.16) 0%,
    rgba(168, 85, 247, 0.08) 50%,
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 1;
}

.xray-toggle-btn:hover::before,
.xray-toggle-btn:hover::after {
  opacity: 1;
}

.xray-toggle-btn:hover {
  background: #282d38;
  border-color: transparent;
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.xray-toggle-btn:active {
  background: #1c2027;
  transform: none;
  box-shadow: none;
}

.xray-toggle-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.xray-toggle-btn:disabled::before,
.xray-toggle-btn:disabled::after {
  display: none !important;
}

.xray-toggle-btn > span {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/* 4. Katman: 2 Satırlık Şeffaf Terminal */
.xray-terminal {
  background: rgba(14, 17, 23, 0.6);
  border: 1px solid rgba(38, 42, 52, 0.8);
  border-radius: 0.65rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.72rem;
  line-height: 1.45;
  box-sizing: border-box;
  margin-top: 1.25rem;
}

.terminal-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 1.15rem;
}

.terminal-prefix {
  color: #64748b;
  font-weight: 700;
  user-select: none;
}

.terminal-content {
  color: #cbd5e1;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.terminal-row.line-1 .terminal-content {
  color: #e2e8f0;
  font-weight: 500;
}

.terminal-row.line-2 .terminal-content {
  color: #94a3b8;
}

.terminal-content.highlight {
  color: #38bdf8 !important;
}

/* ==========================================================================
   Responsive & 4K / 8K Orantısal Tasarım
   ========================================================================== */
@media (max-width: 640px) {
  .xray-card {
    padding: 0.85rem 1.15rem;
    border-radius: 1rem;
  }

  .xray-screen-area {
    min-height: 10.5rem;
    padding: 1.1rem 0.85rem;
  }

  .layer-human .xray-sentence {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
  }

  .layer-matrix .matrix-grid {
    font-size: 0.74rem;
    gap: 0.3rem;
  }

  .matrix-val {
    min-width: 3.8ch;
  }

  .xray-perception-tag,
  .xray-reality-tag {
    font-size: 0.68rem;
    padding: 0.25rem 0.55rem;
  }

  .xray-toggle-btn {
    font-size: 0.78rem;
    padding: 0.6rem 1.05rem;
    width: 100%;
  }

  .xray-action-row,
  .xray-terminal {
    margin-top: 1rem;
  }

  .xray-terminal {
    font-size: 0.66rem;
    padding: 0.65rem 0.85rem;
  }
}

/* 4K ve 8K Ekran Desteği (rem tabanlı ölçekleme) */
@media (min-width: 2560px) {
  .xray-card-wrapper {
    max-width: min(42rem, 90vw);
  }

  .xray-card {
    border-radius: 1.5rem;
  }
}
