/* ==========================================================================
   Temel Gövde ve Geçiş Stilleri
   ========================================================================== */
body { 
    font-family: 'Inter', sans-serif; 
    margin: 0;
    transition: background-color 0.5s ease-in-out;
}

/* Farklı anlatım türleri için arkaplan renkleri */
.bg-slate-900-body { background-color: #0f172a; }
.bg-red-950-body { background-color: #450a0a; }

/* ==========================================================================
   Animasyonlu Arkaplanlar
   ========================================================================== */

/* Giriş ekranı için hareketli gradyan arkaplan */
.animated-gradient {
    background: linear-gradient(-45deg, #1e3a8a, #4c1d95, #3b0764, #2563eb);
    background-size: 400% 400%;
    animation: gradient-move 15s ease infinite;
}
@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Giriş ekranı için hareketli baloncuklar */
.bubbles {
    position: fixed; 
    width: 100%; 
    height: 100%;
    overflow: hidden; 
    top: 0; 
    left: 0; 
    z-index: 0;
}
.bubble {
    position: absolute; 
    bottom: -150px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: bubble-rise 25s infinite ease-in;
    opacity: 0;
}
.bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 18s; }
.bubble:nth-child(2) { width: 20px; height: 20px; left: 20%; animation-duration: 12s; animation-delay: 1s; }
.bubble:nth-child(3) { width: 50px; height: 50px; left: 25%; animation-duration: 22s; }
.bubble:nth-child(4) { width: 80px; height: 80px; left: 35%; animation-duration: 25s; animation-delay: 3s; }
.bubble:nth-child(5) { width: 35px; height: 35px; left: 50%; animation-duration: 15s; }
.bubble:nth-child(6) { width: 45px; height: 45px; left: 65%; animation-duration: 20s; animation-delay: 1s; }
.bubble:nth-child(7) { width: 25px; height: 25px; left: 75%; animation-duration: 14s; animation-delay: 4s; }
.bubble:nth-child(8) { width: 65px; height: 65px; left: 90%; animation-duration: 24s; animation-delay: 2s; }
.bubble:nth-child(9) { width: 15px; height: 15px; left: 85%; animation-duration: 10s; animation-delay: 5s; }
.bubble:nth-child(10) { width: 40px; height: 40px; left: 5%; animation-duration: 19s; animation-delay: 6s; }

@keyframes bubble-rise {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.7; }
    100% { transform: translateY(-120vh) scale(1.2) rotate(360deg); opacity: 0; }
}

/* ==========================================================================
   Genel Component Stilleri
   ========================================================================== */

/* Seçili ders butonu için gökkuşağı çerçeve efekti */
.rainbow-active { 
    position: relative; 
    z-index: 1; 
    background: #1a202c; 
    color: white; 
    border: 2px solid transparent; 
}
.rainbow-active::before { 
    content: ''; 
    position: absolute; 
    top: -2px; left: -2px; right: -2px; bottom: -2px; 
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000); 
    background-size: 400%; 
    border-radius: 0.5rem; 
    z-index: -1; 
    animation: rainbow-move 3s linear infinite; 
}
@keyframes rainbow-move { 
    0% { background-position: 0% 50%; } 
    100% { background-position: 100% 50%; } 
}

/* Yükleme göstergesi animasyonu */
.loader { 
    border: 5px solid #f3f3f3; 
    border-top: 5px solid #818cf8; 
    border-radius: 50%; 
    width: 50px; 
    height: 50px; 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Başlık için renk değiştirme animasyonu */
.halkali-title { 
    animation: text-color-change 6s linear infinite; 
}
@keyframes text-color-change { 
    0% {color: #a78bfa;} 
    25% {color: #f472b6;} 
    50% {color: #34d399;} 
    75% {color: #fb923c;} 
    100% {color: #a78bfa;} 
}

/* Cevap şıkkı butonları için hover efekti */
.answer-button { 
    transition: all 0.2s ease-in-out; 
}
.answer-button:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

/* ==========================================================================
   Matematiksel Gösterim (KaTeX) ve Çözüm Stilleri
   ========================================================================== */
.katex { color: #e2e8f0; }

.inline-math { 
    display: inline-block; 
    background-color: rgba(255, 255, 255, 0.08); 
    padding: 2px 8px; 
    border-radius: 6px; 
    margin: 0 4px; 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    vertical-align: baseline; 
    font-weight: normal !important; 
}

/* Sohbet balonu içindeki matematiksel ifadeler için özel stiller */
.chat-bubble .katex { color: #1f2937; }
.chat-bubble .inline-math { 
    background-color: rgba(0, 0, 0, 0.05); 
    border-color: rgba(0, 0, 0, 0.1); 
}

/* Uzun metinlerin ve formüllerin taşmasını engelleme */
.solution-container p, .solution-container div, .chat-bubble { 
    overflow-wrap: break-word; 
    word-wrap: break-word; 
    word-break: break-word; 
}
.katex-display { 
    overflow-x: auto; 
    overflow-y: hidden; 
    padding: 8px 4px; 
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.katex-display::-webkit-scrollbar { 
    display: none; /* Chrome, Safari, Opera */
}

/* Sohbet ekranı için WhatsApp benzeri arkaplan */
.chat-background-whatsapp { 
    background-color: #e5ddd5; 
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARMAAAARCAYAAAA/I25VAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEQSURBVMgV41RBDsFQDBX/g21g7VbswEjrD3Zg1Q5W7ECt2B5swY49WBhR8wsZIT8G2F/k5xJ5mZtJ5J2R/ZzZ+XW22y22W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W202W2-1s"); 
}

/* ==========================================================================
   Sesli Anlatım Stilleri
   ========================================================================== */

/* Kara tahta görünümü */
.chalkboard {
    background-color: #2E462E; /* Koyu Yeşil Tahta Rengi */
    border: 10px solid #8B5A2B; /* Ahşap Çerçeve Rengi */
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    font-family: 'Inter', sans-serif; /* Normal, okunaklı yazı tipi */
    color: white;
    min-height: 300px;
}
.chalkboard .katex, .chalkboard .katex-display, .chalkboard .inline-math {
    color: #fff !important;
}
.chalkboard .inline-math {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Adımların ekranda belirmesi için animasyon */
.fade-in { 
    animation: fadeIn 0.7s ease-in-out; 
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Premium Kilit Ekranı Stilleri
   ========================================================================== */
.star-field { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #000; 
    overflow: hidden; 
}
.stars { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    transform: rotate(45deg); 
}
.star { 
    --star-color: #FFF; 
    --star-tail-length: 6em; 
    --star-tail-height: 2px; 
    --star-width: 9px; 
    --star-height: 2px; 
    --fall-duration: 9s; 
    --tail-fade-duration: 3s; 
    position: absolute; 
    top: var(--top-offset); 
    left: 0; 
    width: var(--star-width); 
    height: var(--star-height); 
    background: linear-gradient(45deg, transparent, var(--star-color), transparent); 
    border-radius: 50%; 
    animation: fall var(--fall-duration) linear infinite, tail-fade var(--tail-fade-duration) ease-out infinite; 
}
.star::before, .star::after { 
    position: absolute; 
    content: ''; 
    top: 0; 
    left: calc(var(--star-width) / 2); 
    width: var(--star-height); 
    height: var(--star-width); 
    background: linear-gradient(45deg, transparent, var(--star-color), transparent); 
    border-radius: 50%; 
    transform: rotate(90deg); 
}
.star::before { transform: rotate(45deg); }
.star::after { transform: rotate(-45deg); }

@keyframes fall { 
    to { transform: translateX(var(--left-end)); } 
}
@keyframes tail-fade { 
    0%, 50% { width: var(--star-tail-length); opacity: 1; } 
    70%, 80% { width: 0; opacity: 0.4; } 
    100% { width: 0; opacity: 0; } 
}
