
html, body {
  width: 100%;
  overflow-x: hidden;
  /* Mobil cihazlarda "pull-to-refresh" gibi davranışları engeller */
  overscroll-behavior: none;
}

body {
  font-family: 'Poppins', sans-serif;
}

.stable-scrollbar {
  scrollbar-gutter: stable;
}

body.modal-open main {
  overflow: hidden;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-slide-left {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* YENİ EKLENEN ANİMASYON: Pop efektli açılış */
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-down-bounce {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  60% {
    opacity: 1;
    transform: translateY(10px);
  }
  80% {
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%) skewX(-20deg); }
  100% { transform: translateX(200%) skewX(-20deg); }
}

@keyframes gradient-animation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* YENİ: Yavaş Dönme Animasyonu */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite; /* 8 saniyede bir tur, linear akış */
  will-change: transform; /* Performans optimizasyonu */
}

.animate-fade-in {
  animation: fade-in 0.4s ease-out forwards;
}

.animate-fade-in-slide-left {
  animation: fade-in-slide-left 0.4s ease-out forwards;
}

.animate-stagger {
  opacity: 0;
  animation: fade-in-slide-up 0.5s ease-out forwards;
}

.animate-scale-in {
  animation: scale-in 0.3s ease-out forwards;
}

.animate-slide-down-bounce {
  animation: slide-down-bounce 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Yeni class */
.animate-pop-in {
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.shimmer-effect {
  position: relative;
  overflow: hidden;
}
.shimmer-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
  animation: shimmer 15s infinite linear;
  pointer-events: none;
  z-index: 0;
}
.dark .shimmer-effect::after {
   background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(255, 255, 255, 0) 100%);
}

.bg-animated-gradient {
  background: linear-gradient(-45deg, #1f2937, #374151, #111827, #4b5563);
  background-size: 400% 400%;
  animation: gradient-animation 15s ease infinite;
}

.node-3d {
  position: relative;
  /* Geçiş süresini kısalttık (0.1s) böylece basma hissi daha anlık ve tatmin edici olur */
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}
.node-3d.node-unlocked:hover:not(:disabled) {
  /* Hover durumunda biraz daha yukarı kalkıp gölgesi uzuyor */
  transform: translateY(-6px) scale(1.02);
  box-shadow: inset 0 4px 3px 0 rgba(255,255,255,0.5), inset 0 -4px 3px 0 rgba(0,0,0,0.2), 0 10px 0 0 #0f766e, 0 22px 30px -5px rgba(0, 0, 0, 0.3), 0 12px 12px -5px rgba(0, 0, 0, 0.15);
}
.node-3d.node-unlocked:active:not(:disabled) {
  /* BASMA EFEKTİ: Animasyon durur, buton 6px aşağı iner, gölge sıfırlanır */
  animation: none;
  transform: translateY(6px);
  box-shadow: inset 0 3px 5px 0 rgba(0,0,0,0.4), 0 0 0 0 #0f766e, 0 0 0 0 rgba(0,0,0,0);
}
.node-3d.node-completed {
  background: radial-gradient(circle at 50% 0%, #6ee7b7, #10b981);
  border-bottom: 6px solid #059669;
  box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #047857, 0 10px 15px -3px rgba(16, 185, 129, 0.3), 0 4px 6px -2px rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
}
.node-3d.node-unlocked {
  background: radial-gradient(circle at 50% 0%, #4fd1c5, #14b8a6);
  border-bottom: 6px solid #0d9488;
  box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #0f766e, 0 10px 15px -3px rgba(20, 184, 166, 0.3), 0 4px 6px -2px rgba(20, 184, 166, 0.2);
  animation: pulse-effect 2.5s infinite;
  transform: translateY(-4px);
}
.node-3d.node-locked {
  background: radial-gradient(circle at 50% 0%, #a3a3a3, #737373);
  border-bottom: 6px solid #525252;
  box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.2), inset 0 -3px 2px 0 rgba(0,0,0,0.3), 0 6px 0 0 #404040, 0 5px 10px -3px rgba(0, 0, 0, 0.3);
  transform: translateY(0);
}
@keyframes pulse-effect { 
  0%, 100% { transform: translateY(-4px); box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #0f766e, 0 10px 15px -3px rgba(20, 184, 166, 0.3), 0 4px 6px -2px rgba(20, 184, 166, 0.2); } 
  50% { transform: translateY(-6px); box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #0f766e, 0 15px 20px -5px rgba(20, 184, 166, 0.4), 0 8px 8px -5px rgba(20, 184, 166, 0.3); } 
}

.btn-interactive {
    transition: all 0.1s ease-out;
    -webkit-tap-highlight-color: transparent;
}
.btn-interactive:active {
    transform: scale(0.96);
}


@keyframes math-symbol-bounce {
  0%, 80%, 100% {
    transform: scale(0.8) translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.1) translateY(-5px);
    opacity: 1;
  }
}
.math-symbol-loader {
  display: inline-block;
  animation: math-symbol-bounce 1.4s infinite ease-in-out both;
}

/* Matematiksel ifadeler için ek stiller */
.overline {
  border-top: 1px solid currentColor;
  padding: 0 2px;
}

/* Giraffe Theme Styles */
.theme-giraffe {
    --theme-bg-primary-rgb: 253, 251, 245; /* #FDFBF5 */
    --theme-bg-secondary-rgb: 255, 255, 255; /* #FFFFFF */
    --theme-text-primary-rgb: 79, 66, 53; /* #4F4235 */

    --theme-bg-primary: #FDFBF5;
    --theme-bg-secondary: #FFFFFF;
    --theme-bg-secondary-hover: #F8F6F1;
    --theme-bg-muted: #F5F1E8;
    --theme-bg-accent-muted: #FEF3C7; /* amber-100 */

    --theme-text-primary: #4F4235;
    --theme-text-secondary: #6D5D4E; /* Darkened for better contrast */
    --theme-text-muted: #8C7B6C; /* Darkened for better contrast */
    --theme-text-accent: #B45309; /* amber-700 */

    --theme-border-primary: #E0D5C1; /* Darkened for better definition */
    --theme-border-hover: #F59E0B; /* amber-500 */

    /* Buttons and primary actions */
    --theme-accent-primary: #F59E0B; /* amber-500 */
    --theme-accent-primary-hover: #D97706; /* amber-600 */
    --theme-accent-primary-darker: #92400E; /* amber-800 */
    
    --theme-accent-secondary: #FBBF24; /* amber-400 */
    --theme-accent-danger: #DC2626; /* red-600 */
    --theme-accent-danger-hover: #B91C1C; /* red-700 */
    --theme-accent-danger-darker: #991B1B; /* red-800 */
    --theme-accent-success: #16A34A; /* green-600 */
}

.theme-giraffe h1, .theme-giraffe h2, .theme-giraffe h3 {
  text-shadow: 0 1px 2px rgba(var(--theme-text-primary-rgb), 0.05);
}

/* Base Overrides */
.theme-giraffe body,
.theme-giraffe .bg-slate-50, .theme-giraffe .dark\:bg-gray-900,
.theme-giraffe .bg-slate-100 {
    background-color: var(--theme-bg-primary);
    color: var(--theme-text-primary);
    background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 3a1.5 1.5 0 000 3 1.5 1.5 0 000-3zM3 15a1.5 1.5 0 000 3 1.5 1.5 0 000-3zM27 15a1.5 1.5 0 000 3 1.5 1.5 0 000-3zM15 27a1.5 1.5 0 000 3 1.5 1.5 0 000-3z' fill='%23C7BFA8' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Card Overrides for better separation */
.theme-giraffe .bg-white, .theme-giraffe .dark\:bg-gray-800 { 
  background-color: var(--theme-bg-secondary); 
  box-shadow: 0 4px 14px rgba(var(--theme-text-primary-rgb), 0.07), 0 1px 3px rgba(var(--theme-text-primary-rgb), 0.1); /* Increased shadow */
}
.theme-giraffe .hover\:bg-gray-50:hover, .theme-giraffe .dark\:hover\:bg-gray-700:hover { background-color: var(--theme-bg-secondary-hover); }
.theme-giraffe .hover\:bg-gray-100:hover, .theme-giraffe .dark\:hover\:bg-gray-700:hover { background-color: var(--theme-bg-muted); }
.theme-giraffe .bg-gray-50, .theme-giraffe .dark\:bg-gray-700\/50 { background-color: var(--theme-bg-muted); }
.theme-giraffe .bg-gray-100, .theme-giraffe .dark\:bg-gray-800 { background-color: var(--theme-bg-muted); }

/* Text Overrides */
.theme-giraffe .text-gray-900, .theme-giraffe .dark\:text-white { color: var(--theme-text-primary); }
.theme-giraffe .text-gray-800, .theme-giraffe .dark\:text-gray-200 { color: var(--theme-text-primary); }
.theme-giraffe .text-gray-700, .theme-giraffe .dark\:text-gray-300 { color: var(--theme-text-secondary); }
.theme-giraffe .text-gray-600, .theme-giraffe .dark\:text-gray-400 { color: var(--theme-text-secondary); }
.theme-giraffe .text-gray-500, .theme-giraffe .dark\:text-gray-400 { color: var(--theme-text-muted); }
.theme-giraffe .dark\:text-gray-500 { color: var(--theme-text-muted); }

/* Border Overrides */
.theme-giraffe .border-gray-200, .theme-giraffe .dark\:border-gray-700 { border-color: var(--theme-border-primary); }
.theme-giraffe .border-gray-300, .theme-giraffe .dark\:border-gray-600 { border-color: var(--theme-border-primary); }
.theme-giraffe .hover\:border-blue-400:hover, .theme-giraffe .dark\:hover\:border-blue-500:hover { border-color: var(--theme-border-hover); }

/* Accent Color (Blue -> Amber/Gold) Overrides */
.theme-giraffe .bg-blue-600 { background-color: var(--theme-accent-primary); border-color: var(--theme-accent-primary-darker); }
.theme-giraffe .hover\:bg-blue-700:hover { background-color: var(--theme-accent-primary-hover); }
.theme-giraffe .text-blue-500 { color: var(--theme-text-accent); }
.theme-giraffe .text-blue-600, .theme-giraffe .dark\:text-blue-400 { color: var(--theme-text-accent); }
.theme-giraffe .border-blue-500 { border-color: var(--theme-accent-primary); }
.theme-giraffe .focus\:ring-blue-500:focus { --tw-ring-color: var(--theme-accent-primary); }
.theme-giraffe .bg-blue-50, .theme-giraffe .dark\:bg-blue-900\/30, .theme-giraffe .dark\:bg-blue-900\/50 { background-color: var(--theme-bg-accent-muted); }
.theme-giraffe .border-blue-200, .theme-giraffe .dark\:border-blue-800 { border-color: #FBD3A3; }
.theme-giraffe .bg-blue-100, .theme-giraffe .dark\:bg-blue-900\/50 { background-color: var(--theme-bg-accent-muted); }
.theme-giraffe .text-blue-800, .theme-giraffe .dark\:text-blue-200 { color: var(--theme-text-primary); }

/* Other Accent Colors */
.theme-giraffe .text-yellow-500, .theme-giraffe .dark\:text-yellow-400 { color: var(--theme-accent-secondary); }
.theme-giraffe .text-yellow-400 { color: var(--theme-accent-secondary); }
.theme-giraffe .bg-yellow-100, .theme-giraffe .dark\:bg-yellow-900\/50 { background-color: rgba(251, 191, 36, 0.1); }

.theme-giraffe .bg-red-600, .theme-giraffe .dark\:bg-red-700 { background-color: var(--theme-accent-danger); border-color: var(--theme-accent-danger-darker);}
.theme-giraffe .hover\:bg-red-700:hover, .theme-giraffe .dark\:hover\:bg-red-800:hover { background-color: var(--theme-accent-danger-hover); }
.theme-giraffe .text-red-600, .theme-giraffe .dark\:text-red-400 { color: var(--theme-accent-danger); }
.theme-giraffe .text-red-500 { color: var(--theme-accent-danger); }
.theme-giraffe .bg-red-50, .theme-giraffe .dark\:bg-red-900\/30 { background-color: rgba(220, 38, 38, 0.1); }
.theme-giraffe .bg-red-100, .theme-giraffe .dark\:bg-red-900\/50 { background-color: rgba(220, 38, 38, 0.2); }

/* Nav */
.theme-giraffe nav.bg-white\/80 {
  background-color: var(--theme-bg-muted);
  border-top-color: var(--theme-border-primary);
  box-shadow: 0 -2px 10px rgba(var(--theme-text-primary-rgb), 0.1);
  backdrop-filter: none;
}
.theme-giraffe nav button {
  color: var(--theme-text-muted);
}
.theme-giraffe nav button.text-blue-500 { /* Active button */
  color: var(--theme-text-accent) !important;
}
.theme-giraffe aside .bg-blue-500 {
  background-color: var(--theme-accent-primary) !important;
  color: white !important;
}

/* Learning Path Nodes */
.theme-giraffe .node-3d.node-unlocked {
    background: radial-gradient(circle at 50% 0%, var(--theme-accent-secondary), var(--theme-accent-primary));
    border-bottom: 6px solid var(--theme-accent-primary-hover);
    box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #B45309, 0 10px 15px -3px rgba(217, 119, 6, 0.3), 0 4px 6px -2px rgba(217, 119, 6, 0.2);
}
.theme-giraffe .node-3d.node-unlocked:hover:not(:disabled) {
    transform: translateY(-6px) scale(1.02);
    box-shadow: inset 0 4px 3px 0 rgba(255,255,255,0.5), inset 0 -4px 3px 0 rgba(0,0,0,0.2), 0 10px 0 0 #B45309, 0 22px 30px -5px rgba(0, 0, 0, 0.3), 0 12px 12px -5px rgba(0, 0, 0, 0.15);
}
.theme-giraffe .node-3d.node-unlocked:active:not(:disabled) {
  /* Zürafa Teması için BASMA EFEKTİ */
  animation: none;
  transform: translateY(6px);
  /* Gölgeyi tamamen kaldırıp butonun zemine yapışmasını sağlıyoruz */
  box-shadow: inset 0 3px 5px 0 rgba(0,0,0,0.3), 0 0 0 0 #B45309, 0 0 0 0 rgba(0,0,0,0);
}
.theme-giraffe .node-3d.node-locked {
    background: radial-gradient(circle at 50% 0%, #D1C5B0, #B0A38D);
    border-bottom: 6px solid #8F7A78;
    box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.2), inset 0 -3px 2px 0 rgba(0,0,0,0.3), 0 6px 0 0 #6A5553, 0 5px 10px -3px rgba(0, 0, 0, 0.3);
}
@keyframes pulse-effect-giraffe { 
    0%, 100% { 
        transform: translateY(-4px); 
        box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #B45309, 0 10px 15px -3px rgba(217, 119, 6, 0.3), 0 4px 6px -2px rgba(217, 119, 6, 0.2);
    } 
    50% { 
        transform: translateY(-6px); 
        box-shadow: inset 0 3px 2px 0 rgba(255,255,255,0.4), inset 0 -3px 2px 0 rgba(0,0,0,0.2), 0 6px 0 0 #B45309, 0 15px 20px -5px rgba(217, 119, 6, 0.4), 0 8px 8px -5px rgba(217, 119, 6, 0.3); 
    } 
}
.theme-giraffe .node-3d.node-unlocked { animation: pulse-effect-giraffe 2.5s infinite; }

.theme-giraffe .theme-giraffe-outline-button {
  border-width: 1px;
  border-color: var(--theme-border-primary);
  box-shadow: 0 1px 3px rgba(var(--theme-text-primary-rgb), 0.04);
}
.theme-giraffe .theme-giraffe-outline-button:hover {
    border-color: var(--theme-border-hover);
    background-color: var(--theme-bg-secondary-hover);
}
