/* ==============================================================================
   GÜNEŞ-LANG ÇEVRİMİÇİ GELİŞTİRME ORTAMI (STUDIO / IDE) STİLLERİ
   ============================================================================== */

:root {
  --bg: #05070B;
  --bg-card: #0A0E18;
  --bg-card-hover: #101626;
  --bg-editor: #070A10;
  --border: rgba(255, 215, 0, 0.18);
  --border-bright: rgba(255, 215, 0, 0.55);
  --border-cyan: rgba(0, 229, 255, 0.35);
  --gold: #FFD700;
  --gold-light: #FFE57F;
  --gold-glow: rgba(255, 215, 0, 0.4);
  --accent-cyan: #00E5FF;
  --accent-green: #00E676;
  --accent-purple: #B388FF;
  --accent-red: #FF5252;
  --text: #F0F4F8;
  --text-muted: #8F9BB3;
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(255, 170, 0, 0.14) 0%, transparent 60%),
    radial-gradient(circle at 90% 30%, rgba(0, 229, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 10% 70%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: rgba(255, 215, 0, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Üst Başlık (Header Navbar) */
header.ide-header {
  background: rgba(5, 7, 11, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-wrap img {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1.2px;
  line-height: 1.1;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.nav-links-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link-btn {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link-btn:hover {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
  border-color: var(--border);
}

.nav-link-btn.highlight {
  color: var(--gold);
  border-color: var(--border-bright);
  background: rgba(255, 215, 0, 0.1);
}

/* Ana Alan (Workspace Grid) */
main.ide-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 20px;
  flex: 1;
}

@media (max-width: 1100px) {
  main.ide-container {
    grid-template-columns: 1fr;
  }
}

main.ide-container > * {
  min-width: 0;
}

/* Sol Panel: Editör ve Araç Çubuğu */
.editor-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toolbar {
  background: rgba(10, 14, 24, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #FF9800);
  color: #05070B;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
  border-color: var(--border);
}

.btn-audio {
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent-cyan);
  border-color: var(--border-cyan);
}

.btn-audio.active {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.select-dropdown {
  background: #0f1626;
  color: var(--gold-light);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.select-dropdown:hover, .select-dropdown:focus {
  border-color: var(--gold);
}

/* Editör Gövdesi */
.editor-body {
  position: relative;
  flex: 1;
  min-height: 520px;
  background: var(--bg-editor);
  display: flex;
}

.line-numbers {
  width: 48px;
  padding: 16px 8px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
  color: #4b5563;
  user-select: none;
  background: #06090e;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.editor-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.code-input, .highlight-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  border: none;
  outline: none;
  box-sizing: border-box;
}

.highlight-area {
  z-index: 1;
  pointer-events: none;
  color: var(--text);
  background: transparent;
}

.code-input {
  z-index: 2;
  color: transparent;
  background: transparent;
  caret-color: var(--gold);
  resize: none;
}

/* SÖZDİZİMİ RENKLERİ (SYNTAX THEME) */
.token-keyword {
  color: var(--gold);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.35);
}

.token-builtin {
  color: var(--accent-cyan);
  font-weight: 600;
}

.token-func {
  color: #38BDF8;
  font-weight: 600;
}

.token-string {
  color: #4ADE80;
}

.token-number {
  color: #FB923C;
}

.token-bool {
  color: #F43F5E;
  font-weight: 600;
}

.token-comment {
  color: #64748B;
  font-style: italic;
}

.token-operator {
  color: #FCD34D;
}

.token-punct {
  color: #94A3B8;
}

/* Sağ Panel: Konsol ve WERR Telemetri */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.panel-header {
  background: rgba(10, 14, 24, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-idle { color: #94A3B8; background: rgba(148, 163, 184, 0.1); }
.status-running { color: var(--gold); background: rgba(255, 215, 0, 0.15); }
.status-success { color: var(--accent-green); background: rgba(0, 230, 118, 0.15); }
.status-error { color: var(--accent-red); background: rgba(255, 82, 82, 0.15); }

/* Konsol Çıktı Alanı */
.console-body {
  background: #030508;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  min-height: 240px;
  max-height: 320px;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.console-line {
  margin-bottom: 3px;
  word-break: break-all;
}

.console-stdout {
  color: #E2E8F0;
}

.console-system {
  color: var(--text-muted);
  font-style: italic;
}

.console-error {
  color: var(--accent-red);
  background: rgba(255, 82, 82, 0.1);
  padding: 4px 8px;
  border-left: 3px solid var(--accent-red);
  border-radius: 2px;
}

/* WERR 53-Hölder Telemetri Kartı */
.telemetry-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.telemetry-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dial-wrap {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.stats-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
}

.stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 2px;
}

.stat-val.cyan {
  color: var(--accent-cyan);
}

.stat-val.green {
  color: var(--accent-green);
}

/* Bilgi Kutusu */
.info-box {
  background: rgba(255, 215, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-box b {
  color: var(--gold);
}

/* Alt Bilgi (Footer) */
footer.ide-footer {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  font-size: 12px;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(5, 7, 11, 0.95);
}

footer.ide-footer a {
  color: var(--gold);
  text-decoration: none;
}

footer.ide-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  header.ide-header {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .brand-wrap {
    justify-content: center;
  }
  .brand-text h1 {
    font-size: 16px;
  }
  .nav-links-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav-link-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  main.ide-container {
    padding: 10px 8px;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar {
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .toolbar-group {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }
  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .select-dropdown, select.sample-select {
    flex: 1 1 140px;
    min-width: 0;
    max-width: 100%;
    font-size: 11.5px;
    padding: 6px 8px;
    text-overflow: ellipsis;
  }
  .editor-body {
    min-height: 380px;
  }
  .line-numbers {
    width: 36px;
    padding: 12px 4px;
    font-size: 11.5px;
  }
  .code-input, .highlight-area {
    padding: 12px 10px;
    font-size: 12px;
  }
  .telemetry-row {
    flex-direction: column;
    align-items: center;
  }
  .stats-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  footer.ide-footer {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    padding: 12px 10px;
  }
}
