/* Yaren Python — Özel Stiller */

:root {
  --primary: #a78bfa;
  --primary-dark: #7c3aed;
  --secondary: #f9a8d4;
  --accent: #fbbf24;
  --bg-warm: #fdf4ff;
  --bg-warm-2: #fff1f5;
  --text-main: #3b0764;
  --text-soft: #6b21a8;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Quicksand', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-warm-2) 100%);
  min-height: 100vh;
}

body.dark {
  background: linear-gradient(135deg, #1e1b2e 0%, #2d1b3d 100%);
  color: #f3e8ff;
}

body.dark .card {
  background: #2d2340;
  color: #f3e8ff;
  border-color: #4c1d95;
}

body.dark .nav-top {
  background: rgba(30, 27, 46, 0.95);
  border-color: #4c1d95;
}

/* Yılan maskot animasyonu */
@keyframes snake-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
.snake-mascot {
  animation: snake-wiggle 3s ease-in-out infinite;
  transform-origin: center bottom;
}

/* Konfeti animasyonu */
@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  animation: confetti-fall 3s linear forwards;
  z-index: 9999;
}

/* Kart stili */
.card {
  background: white;
  border-radius: 1.25rem;
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(167, 139, 250, 0.25);
}

/* Buton stili */
.btn-primary {
  background: linear-gradient(135deg, #a78bfa 0%, #f9a8d4 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: white;
  color: var(--primary-dark);
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

/* Top nav */
.nav-top {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.2);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* XP bar */
.xp-bar {
  height: 8px;
  background: rgba(167, 139, 250, 0.2);
  border-radius: 9999px;
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #a78bfa, #f9a8d4);
  transition: width 0.5s ease;
}

/* Kod editörü konteyner (CodeMirror 5) */
.editor-container {
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: #282a36;
  position: relative;
}
.editor-container .CodeMirror {
  height: 100%;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}
.editor-container .CodeMirror-gutters {
  background: #21222c;
  border-right: 1px solid rgba(167, 139, 250, 0.2);
}
.editor-container .CodeMirror-linenumber {
  color: #6272a4;
}

/* Çıktı paneli */
.output-panel {
  background: #1e1b2e;
  color: #f3e8ff;
  font-family: 'Fira Code', 'Courier New', monospace;
  padding: 1rem;
  border-radius: 0.75rem;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.9rem;
  line-height: 1.5;
}
.output-panel .err { color: #fca5a5; }
.output-panel .ok { color: #86efac; }
.output-panel .hint { color: #fcd34d; font-style: italic; }

/* Rozet */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 168, 212, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 0.85rem;
  font-weight: 600;
}
.badge.locked { opacity: 0.35; filter: grayscale(0.5); }

/* Sayfa geçiş */
.page-enter {
  animation: fade-in 0.4s ease-out;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, 0.4); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.7); }

/* Responsive kod editörü */
@media (max-width: 768px) {
  .lesson-layout { grid-template-columns: 1fr !important; }
  .output-panel { font-size: 0.8rem; }
}
