/* ==========================================================================
   Slide 4: Artificial Neural Network (ANN) Simulation Styles (Glassmorphism)
   ========================================================================== */

/* Ana Merkez Sütun */
.ann-container {
  width: 100%;
  max-width: min(45rem, 92vw);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  z-index: 10;
}

/* 1. Katman: Girdi Alanı & Kontroller (Glassmorphism) */
.ann-input-card {
  background: rgba(22, 25, 31, 0.72);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ann-input-card:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.05);
}

.input-left-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}

.pixel-pad-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

/* 8 Piksellik İnteraktif Matris (2x4) - 4K/8K & Mobil Uyumlu */
.pixel-grid {
  display: grid;
  grid-template-columns: repeat(2, clamp(16px, 1.22rem, 2.6rem));
  grid-template-rows: repeat(4, clamp(16px, 1.22rem, 2.6rem));
  gap: clamp(2px, 0.2rem, 5px);
  padding: clamp(3px, 0.24rem, 6px);
  background: #090b0e;
  border: 1px solid #262a34;
  border-radius: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.pixel-cell {
  width: clamp(16px, 1.22rem, 2.6rem);
  height: clamp(16px, 1.22rem, 2.6rem);
  background: #191d24;
  border-radius: 2px;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.pixel-cell:hover {
  background: #2b3240;
}

.pixel-cell.active {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
}

/* Preset Butonları ("8", "0", "3") */
.preset-selector {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.preset-label {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preset-buttons {
  display: flex;
  gap: 0.4rem;
}

.preset-btn {
  width: 2rem;
  height: 2rem;
  background: #14171d;
  border: 1px solid #262a34;
  border-radius: 0.45rem;
  color: #e5e7eb;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: #202530;
  border-color: rgba(255, 255, 255, 0.25);
}

.preset-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Kapalı Gri "Ağı Çalıştır" Butonu (Google Tarzı Dinamik Spotlight Kenarlık) */
.ann-run-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%;
}

.ann-run-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;
}

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

.ann-run-btn:hover::before,
.ann-run-btn:hover::after {
  opacity: 1;
}

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

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

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

.ann-run-btn:disabled::before,
.ann-run-btn:disabled::after {
  display: none !important;
}

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

/* 2. Katman: Sinir Ağı Sahnesi (4 Katmanlı Düğüm Ağı) */
.ann-network-card {
  background: rgba(22, 25, 31, 0.72);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

/* Katman Başlıkları */
.layer-legend-row {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
}

.layer-badge {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.64rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.layer-badge.active {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* Ağın SVG Çizim Alanı */
.network-svg-wrap {
  width: 100%;
  height: clamp(190px, 15.5rem, 32rem);
  background: rgba(14, 17, 23, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  position: relative;
  overflow: hidden;
}

.network-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Sinaps Bağlantı Çizgileri */
.synapse-line {
  stroke: #262a34;
  stroke-width: 0.85;
  opacity: 0.6;
  transition: stroke 0.4s ease, opacity 0.4s ease, stroke-width 0.4s ease;
}

.synapse-line.active {
  stroke: rgba(56, 189, 248, 0.75);
  stroke-width: 1.4;
  opacity: 1;
}

.synapse-line.active-green {
  stroke: rgba(16, 185, 129, 0.85);
  stroke-width: 1.6;
  opacity: 1;
}

/* Düğüm (Nöron) Stilleri */
.neuron-node circle {
  fill: #191e28;
  stroke: #333a48;
  stroke-width: 1.5;
  transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
}

.neuron-node text {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 9px;
  font-weight: 600;
  fill: #64748b;
  user-select: none;
  transition: fill 0.3s ease;
}

/* Ateşlenen Nöronlar */
.neuron-node.active-blue circle {
  fill: #0c4a6e;
  stroke: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
}

.neuron-node.active-blue text {
  fill: #ffffff;
}

.neuron-node.active-green circle {
  fill: #064e3b;
  stroke: #10b981;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.9));
}

.neuron-node.active-green text {
  fill: #ffffff;
  font-weight: 700;
}

/* Çıktı Nöronu Skor Göstergesi */
.output-score-tag {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 8.5px;
  font-weight: 600;
  fill: #64748b;
  opacity: 0;
  transition: opacity 0.3s ease, fill 0.3s ease;
}

.output-score-tag.visible {
  opacity: 1;
}

.output-score-tag.winner {
  fill: #10b981;
  font-weight: 700;
}

/* 3. Katman: Bilgi Konsolu (Terminal) */
.ann-terminal-card {
  background: rgba(12, 14, 19, 0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  padding: 0.65rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  min-height: 4.8rem;
}

.terminal-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.3rem;
  margin-bottom: 0.15rem;
}

.term-title {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.66rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.term-status-badge {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.66rem;
  font-weight: 700;
  color: #94a3b8;
}

.term-status-badge.running {
  color: #38bdf8;
}

.term-status-badge.completed {
  color: #10b981;
}

.term-logs {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 0.73rem;
  line-height: 1.45;
  color: #e5e7eb;
}

.log-line {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.log-prompt {
  color: #10b981;
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}

.log-text {
  color: #e5e7eb;
}

.log-cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: #10b981;
  vertical-align: middle;
  margin-left: 2px;
  animation: annBlink 0.9s infinite;
}

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

@media (max-width: 640px) {
  .ann-input-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
  }
  .input-left-group {
    justify-content: space-between;
  }
  .ann-run-btn {
    width: 100%;
    justify-content: center;
  }
  .network-svg-wrap {
    height: clamp(170px, 13.5rem, 210px);
  }
  .ann-terminal-card {
    padding: 0.5rem 0.75rem;
    min-height: 4rem;
  }
  .term-logs {
    font-size: 0.68rem;
  }
}
