/*
Theme Name: Thematic Mathematics
Theme URI: https://thematicmathematics.com
Author: Incredible Science
Description: Pure CSS & PHP Theme with 3D Sphere Core.
Version: 1.2 (Black Layer Fix)
*/

:root {
    --s: 2s;      /*speed*/
    --d: 40;      /*delay*/
    --c: #ff6600; /*color*/
    --bg-color: #101010;
}

body {
  margin: 0;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
}


body {
    background: radial-gradient(circle at 50% 100%, #101010, #000);
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Scroll yok, tek ekran */
    font-family: 'Courier New', Courier, monospace;
    color: var(--c);
}

/* --- ANIMASYONLAR --- */
@keyframes steam {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

@keyframes spin {
    0% { transform: rotateX(-210deg) rotateY(0deg) rotatez(185deg); }
    100% { transform: rotateX(-210deg) rotateY(360deg) rotatez(185deg); }
}

@keyframes shine {
    50%, 100% {
        border-color: #10101000;
        box-shadow: 0 0 1px 1px #10101000, 0 0 1px 1px #10101000 inset;
        filter: hue-rotate(540deg);
    }
}

@keyframes blink {
    50% { opacity: 0.5; }
}



/* --- THE SPHERE CORE --- */
.scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000vmin;
    z-index: 0; /* En arkada */
}

.sphere {
    width: 50vmin;
    height: 50vmin;
    background: #ffF0;
    position: relative;
    animation: spin 5s linear 0s infinite;
    animation-play-state: running;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.sphere div {
    --sz: 23%;
    --dv: calc(var(--s) / var(--d));
    --dl: calc(var(--dv) * -1);
    width: var(--sz);
    height: var(--sz);
    position: absolute;
    border: 0.25vmin solid var(--c);
    border-radius: 100%;
    transform: rotateX(90deg) translateZ(24.5vmin);
    box-shadow: 
        0 0 0.5vmin 0.5vmin var(--c), 
        0 0 0.5vmin 0.5vmin var(--c) inset;
    animation: shine var(--s) linear var(--dl) infinite;
    background: #fff0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.sphere div:before {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    border: 0.25vmin solid var(--c);
    border-radius: 100%;
    box-shadow: 0 0 0.5vmin 0.5vmin var(--c), 0 0 0.5vmin 0.5vmin var(--c) inset;
    animation: shine var(--s) linear calc(var(--dl) * -1) infinite;
}

/* Sphere Child Selectors (Loop) */
.sphere div:nth-child(2) { transform: rotateX(90deg) translateZ(22.5vmin); --sz: 43%; --dl: calc(var(--dv) * -2); filter: hue-rotate(-2deg); }
.sphere div:nth-child(3) { transform: rotateX(90deg) translateZ(20vmin); --sz: 60%; --dl: calc(var(--dv) * -3); filter: hue-rotate(-4deg); }
.sphere div:nth-child(4) { transform: rotateX(90deg) translateZ(17.5vmin); --sz: 71%; --dl: calc(var(--dv) * -4); filter: hue-rotate(-6deg); }
.sphere div:nth-child(5) { transform: rotateX(90deg) translateZ(15vmin); --sz: 80%; --dl: calc(var(--dv) * -5); filter: hue-rotate(-8deg); }
.sphere div:nth-child(6) { transform: rotateX(90deg) translateZ(12.5vmin); --sz: 86%; --dl: calc(var(--dv) * -6); filter: hue-rotate(-10deg); }
.sphere div:nth-child(7) { transform: rotateX(90deg) translateZ(10vmin); --sz: 91%; --dl: calc(var(--dv) * -7); filter: hue-rotate(-12deg); }
.sphere div:nth-child(8) { transform: rotateX(90deg) translateZ(7.5vmin); --sz: 95%; --dl: calc(var(--dv) * -8); filter: hue-rotate(-14deg); }
.sphere div:nth-child(9) { transform: rotateX(90deg) translateZ(5vmin); --sz: 97%; --dl: calc(var(--dv) * -9); filter: hue-rotate(-16deg); }
.sphere div:nth-child(10) { transform: rotateX(90deg) translateZ(2.5vmin); --sz: 99%; --dl: calc(var(--dv) * -10); filter: hue-rotate(-18deg); }
.sphere div:nth-child(11) { transform: rotateX(90deg); --sz: 100%; --dl: calc(var(--dv) * -11); filter: hue-rotate(-20deg); }
.sphere div:nth-child(12) { transform: rotateX(90deg) translateZ(-2.5vmin); --sz: 99%; --dl: calc(var(--dv) * -12); filter: hue-rotate(-22deg); }
.sphere div:nth-child(13) { transform: rotateX(90deg) translateZ(-5vmin); --sz: 97%; --dl: calc(var(--dv) * -13); filter: hue-rotate(-24deg); }
.sphere div:nth-child(14) { transform: rotateX(90deg) translateZ(-7.5vmin); --sz: 95%; --dl: calc(var(--dv) * -14); filter: hue-rotate(-26deg); }
.sphere div:nth-child(15) { transform: rotateX(90deg) translateZ(-10vmin); --sz: 91%; --dl: calc(var(--dv) * -15); filter: hue-rotate(-28deg); }
.sphere div:nth-child(16) { transform: rotateX(90deg) translateZ(-12.5vmin); --sz: 86%; --dl: calc(var(--dv) * -16); filter: hue-rotate(-30deg); }
.sphere div:nth-child(17) { transform: rotateX(90deg) translateZ(-15vmin); --sz: 80%; --dl: calc(var(--dv) * -17); filter: hue-rotate(-32deg); }
.sphere div:nth-child(18) { transform: rotateX(90deg) translateZ(-17.5vmin); --sz: 71%; --dl: calc(var(--dv) * -18); filter: hue-rotate(-34deg); }
.sphere div:nth-child(19) { transform: rotateX(90deg) translateZ(-20vmin); --sz: 60%; --dl: calc(var(--dv) * -19); filter: hue-rotate(-36deg); }
.sphere div:nth-child(20) { transform: rotateX(90deg) translateZ(-22.5vmin); --sz: 43%; --dl: calc(var(--dv) * -20); filter: hue-rotate(-38deg); }
.sphere div:nth-child(21) { transform: rotateX(90deg) translateZ(-24.5vmin); --sz: 23%; --dl: calc(var(--dv) * -21); filter: hue-rotate(-40deg); }


/* --- UI OVERLAY --- */
.ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    color: #fff;
    text-shadow: 0 0 20px var(--c), 0 0 40px var(--c);
    margin-bottom: 0px;
    pointer-events: auto;
    mix-blend-mode: screen;
}

.main-menu {
    pointer-events: auto;
    background: transparent;
    padding: 10px;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    margin-top: 0;
}

.main-menu:hover {
    box-shadow: none;
    background: transparent;
}

.main-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 40px;
}

.main-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    transition: all 0.3s ease;
    padding: 5px 0;
    text-shadow: 
        3px 3px 0px #000, 
        0 0 10px #000, 
        0 0 20px #000, 
        0 0 10px var(--c);
}

.main-menu a:hover {
    color: #fff;
    text-shadow: 
        3px 3px 0px #000,
        0 0 15px var(--c),
        0 0 30px var(--c),
        0 0 45px var(--c);
}

.current-menu-item a {
    color: #fff !important;
    text-shadow: 0 0 10px var(--c);
}
.current-menu-item a::after {
    width: 100%;
}


/* --- AJAX AÇILIR PENCERE (SANDVİÇ MODELİ) --- */
#content-stage {
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 900px;
    height: 70vh;
    
    /* ZEMİN RENGİ YOK! Şeffaf bırakıyoruz ki katmanlar işini yapsın */
    background: transparent; 
    
    z-index: 100;
    display: none;
    box-sizing: border-box;
}

/* --- KATMAN 1: RGB BUHARI (EN ALT) --- */
/* Bu katman dışarı taşar ve bulanıktır */
#content-stage::before {
    content: '';
    position: absolute;
    /* Dışarı taşma payı */
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    background: linear-gradient(45deg, #fb0094, #0000ff, #00ff00, #ffff00, #ff0000, #fb0094, #0000ff, #00ff00, #ffff00, #ff0000);
    background-size: 400%;
    z-index: -2; /* En arkaya git */
    animation: steam 20s linear infinite;
    border-radius: 25px; /* Arkadaki biraz daha yumuşak olsun */
    filter: blur(20px); /* Glow efekti */
}

/* --- KATMAN 2: %98 BLACK MASK (ORTA) --- */
/* İŞTE BU SENİN "Bİ KATMAN DAHA" DEDİĞİN YER */
/* Tam kutu boyutunda, simsiyah, buharın üzerini örter */
#content-stage::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 5, 0.99); /* %98 Siyah */
    z-index: -1; /* Buharın önüne, yazının arkasına */
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,1) inset; /* İçeri derinlik ver */
}

/* --- KATMAN 3: İÇERİK (EN ÜST) --- */
.ajax-title {
    font-size: 2.5rem;
    color: #fff;
    border-bottom: 2px solid var(--c);
    padding: 30px 30px 15px 30px;
    margin: 0;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--c);
    position: relative;
    z-index: 2; /* Maskenin üstünde */
}

.ajax-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ddd;
    line-height: 1.6;
    font-size: 1.1rem;
    padding: 20px 40px 40px 40px;
    height: calc(100% - 110px);
    overflow-y: auto;
    position: relative;
    z-index: 2; /* Maskenin üstünde */
}

/* Kapat Butonu */
.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    transition: transform 0.3s;
    font-family: sans-serif;
    line-height: 1;
    z-index: 10;
}
.close-btn:hover {
    color: var(--c);
    transform: rotate(90deg);
}

/* Scrollbar */
#content-stage::-webkit-scrollbar { width: 8px; }
#content-stage::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
#content-stage::-webkit-scrollbar-thumb { background: var(--c); border-radius: 4px; }

/* Yükleniyor Animasyonu */
.loading-spinner {
    text-align: center;
    font-size: 1.5rem;
    color: var(--c);
    margin-top: 20%;
    position: relative;
    z-index: 5;
    animation: blink 1s infinite;
}


/* --- YAZILIM KARTLARI (SADE MOD) --- */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.software-card {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

.software-card:hover {
    transform: translateY(-5px);
    border-color: var(--c);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.card-image {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #333;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.software-card h3 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-desc {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 20px;
    flex-grow: 1;
}

.download-btn {
    display: block;
    text-align: center;
    background: transparent;
    border: 1px solid var(--c);
    color: var(--c);
    padding: 10px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s;
    border-radius: 5px;
}

.download-btn:hover {
    background: var(--c);
    color: #000;
    box-shadow: 0 0 15px var(--c);
}

/* --- POPUP SPLIT VIEW (Yazılım Detayları) --- */
.popup-split-container {
    display: flex;
    gap: 30px;
    height: 100%;
    margin-top: 20px;
    align-items: flex-start;
}

/* Sol Kolon: Yazı */
.popup-left-col {
    flex: 1; /* Kalan boşluğu doldur */
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    display: flex;
    flex-direction: column;
}

/* Sağ Kolon: Resim */
.popup-right-col {
    width: 40%; /* Popup'ın %40'ı resim olsun */
    min-height: 350px; /* Görsel için minimum yükseklik */
    background-size: cover;
    background-position: center;
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Popup içindeki buton */
.popup-cta {
    margin-top: 30px;
    align-self: flex-start; /* Sola yasla */
    padding: 15px 40px;
}

/* MOBİL UYUMU */
@media (max-width: 768px) {
    .popup-split-container {
        flex-direction: column-reverse; /* Mobilde resim üste çıksın */
    }
    .popup-right-col {
        width: 100%;
        height: 250px;
        min-height: auto;
    }
}

/* --- POPUP YATAY DÜZEN (SPLIT VIEW) --- */

/* 1. Kapsayıcı: Flex ile yan yana diziyoruz */
.popup-split-container {
    display: flex;
    flex-direction: row; /* Yan yana olsun */
    width: 100%;
    height: 100%;
    gap: 40px; /* Yazı ile Resim arası boşluk */
    padding: 0 30px 40px 30px; 
    box-sizing: border-box;
}

/* 2. Sol Taraf: Yazı ve Buton */
.popup-left-col {
    flex: 1; /* Kalan boşluğu doldur */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Yazı Stili */
.popup-left-col p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    margin-top: 0;
    margin-bottom: 20px;
}

/* 3. Sağ Taraf: Büyük Görsel */
.popup-right-col {
    width: 45%; /* Popup'ın %45'i resim olsun */
    min-height: 400px; /* Yükseklik garantisi */
    background-size: cover;
    background-position: center;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.6); /* Hafif gölge */
}

/* Butonun Duruşu */
.popup-cta {
    align-self: flex-start; /* Butonu sola yasla */
    padding: 12px 30px;
    margin-top: auto; /* Yazı kısaysa butonu en alta itme opsiyonu */
}

/* MOBİL İÇİN (Telefonda yine alt alta dönsün) */
@media (max-width: 900px) {
    .popup-split-container {
        flex-direction: column-reverse; /* Resim üste çıksın */
    }
    .popup-right-col {
        width: 100%;
        height: 250px;
        min-height: 250px;
    }
}

/* --- YATAY LİSTE MODU (LIST VIEW) --- */

/* 1. Grid Yapısını Tek Sütuna İndir */
.software-grid {
    /* Yan yana kutular yerine, alt alta geniş satırlar olsun */
    grid-template-columns: 1fr !important; 
    gap: 40px; /* Satırlar arası boşluk */
    max-width: 1000px; /* Çok aşırı genişlemesin, ortada dursun */
    margin: 0 auto; /* Ortala */
}

/* 2. Kartın Kendisini Yatay Yap */
.software-card {
    /* İçindekileri (Resim ve Yazı) yan yana diz */
    flex-direction: row; 
    height: auto; /* Sabit yükseklik yerine içeriğe göre uzasın */
    min-height: 280px; /* Ama çok da ince olmasın */
    background: rgba(10, 10, 10, 0.8); /* Biraz daha koyu zemin */
}

/* 3. Resim Ayarı (Sol Taraf) */
.card-image {
    width: 40%; /* Kartın %40'ı resim olsun */
    height: auto; /* Yükseklik otomatik */
    min-height: 100%; /* Kartın boyu kadar uzasın */
    border-bottom: none; /* Eski alt çizgiyi kaldır */
    border-right: 1px solid #333; /* Sağa çizgi ekle */
    background-size: cover;
    background-position: center;
}

/* 4. İçerik Ayarı (Sağ Taraf) */
.card-content {
    width: 60%; /* Kalan alan */
    padding: 30px;
    justify-content: center; /* Dikeyde ortala */
    align-items: flex-start; /* Sola yasla */
}

/* Başlık ve Yazı Düzenlemeleri */
.software-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 0 10px var(--c); /* Senin neon rengin */
}

.card-desc {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 90%; /* Yazı çok sağa yapışmasın */
}

/* Butonun yeri */
.download-btn {
    align-self: flex-start; /* Butonu sola çek */
    padding: 10px 40px;
}


/* --- MOBİL UYUMU (Telefonda Eski Haline Dönsün) --- */
@media (max-width: 768px) {
    .software-card {
        flex-direction: column; /* Tekrar alt alta */
    }
    
    .card-image {
        width: 100%;
        height: 250px;
        border-right: none;
        border-bottom: 1px solid #333;
    }
    
    .card-content {
        width: 100%;
        padding: 20px;
    }
}

/* --- POPUP BUTON AYARLARI (GÜNCEL) --- */

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;             /* Yazı ile Logo arası boşluk */
    padding: 12px 30px;
    
    /* Metin Rengi Beyaz */
    color: #fff !important; 
    
    /* Kenarlık Turuncu kalsın ama yazı beyaz olsun */
    border: 1px solid var(--c);
    text-transform: none; /* İsteğe bağlı: "Available on" küçük harf kalsın dersen bunu aç */
    font-weight: normal;  /* Çok kalın olmasın */
}

/* GitHub Logosu Ayarı */
.btn-gh-logo {
    height: 26px !important; /* Logoyu biraz daha belirgin yaptık */
    width: auto !important;
    display: block;
    margin: 0;
}

/* Hover Efekti */
.download-btn:hover {
    background: rgba(255, 255, 255, 0.1); /* Üstüne gelince hafif beyaz parlasın */
    box-shadow: 0 0 15px var(--c);
}