/* SİSTEM VE TEMEL TASARIM */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 100dvh (Dynamic Viewport Height) mobil tarayıcı çubuklarının içeriği yutmasını engeller */
body, html { height: 100%; overflow: hidden; font-family: 'Segoe UI', Roboto, sans-serif; background-color: #ffffff; }
.app-container { display: flex; height: 100vh; height: 100dvh; }

/* MASAÜSTÜ SOL MENÜ (SİDEBAR) */
.sidebar { width: 280px; background-color: #1a237e; color: white; display: flex; flex-direction: column; box-shadow: 4px 0 15px rgba(0,0,0,0.15); z-index: 10; }
.logo-area { padding: 40px 20px; background-color: #0d124a; text-decoration: none !important; color: white !important; text-align: center; display: block; transition: 0.3s; cursor: pointer; }
.logo-area:hover { background-color: #283593; }
.logo-area h2 { font-size: 1.6rem; letter-spacing: 3px; color: #38bdf8; text-shadow: 1px 1px 2px #000; margin: 0; }
.logo-area p { font-size: 0.75rem; opacity: 0.8; margin-top: 8px; font-weight: bold; }

.nav-menu { flex: 1; padding-top: 25px; }
.nav-item { display: flex; align-items: center; padding: 18px 30px; color: #ffffff; text-decoration: none; transition: all 0.2s; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,0.05); }
.nav-item:hover { background-color: #38bdf8; color: #0d124a; padding-left: 40px; }
.nav-icon { margin-right: 15px; font-size: 1.4rem; }

/* ANA İÇERİK ALANI */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; background: #f8f9fa; }
.page-body { padding: 40px 50px; flex: 1; }
.welcome-text { color: #0d124a; font-size: 2.2rem; margin-bottom: 5px; }

/* VURGULU BAŞLIKLAR (Test alt sayfaları için) */
.page-header { margin-bottom: 30px; border-left: 6px solid #38bdf8; padding-left: 20px; }
.maarif-badge { color: #64748b; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

/* ANA TEST BUTONLARI (testler.html sınıf seçimi için) */
.test-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; width: 100%; max-width: 1000px; margin-top: 20px; }
/* ORİJİNAL TEST KARTI TASARIMI */
.test-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 25px; /* Orijinal ferah boşluk */
    text-align: center;
    text-decoration: none;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px; /* Orijinal dolgun uzunluk */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.test-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.test-card span {
    font-size: 2.2rem; /* Orijinal büyük rakamlar */
    font-weight: 850;
    color: #1a237e;
    line-height: 1;
}

.test-card small {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 8px;
}

/* ÜNİTE KUTUCUKLARI VE PDF LİSTELERİ (test-5, 6, 7, 8 için) */
.tema-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; max-width: 1400px; }
.tema-card { background: white; border: 1px solid #e2e8f0; border-radius: 15px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.tema-header { background: #1a237e; color: white; padding: 15px 20px; font-weight: bold; font-size: 0.95rem; line-height: 1.3; }
.pdf-list { padding: 10px; }
.pdf-item { display: flex; align-items: center; padding: 10px 15px; color: #475569; text-decoration: none; font-size: 0.85rem; border-radius: 8px; transition: 0.2s; border-bottom: 1px solid #f1f5f9; }
.pdf-item:last-child { border-bottom: none; }
.pdf-item:hover { background: #f0f9ff; color: #1a237e; padding-left: 20px; }
.pdf-item::before { content: "📄"; margin-right: 10px; }

/* 8. SINIF LGS ÖZEL RENK GEÇİŞLERİ */
.tema-header.lgs { background: #0d124a; text-transform: uppercase; font-size: 0.85rem;}
.page-header.lgs { border-left: 6px solid #f59e0b; }
.maarif-badge.lgs { color: #b45309; }
.pdf-item.lgs:hover { background: #fffbeb; color: #b45309; }
.pdf-item.lgs::before { content: "📝"; }

/* MOBİL DÜZEN - ALT MENÜ YAPISI (Tüm Sayfalar İçin) */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    
    /* İÇERİĞİN ALT MENÜ ALTINDA KALMASINI ENGELLEYEN BOŞLUK */
    .page-body { padding-bottom: 110px !important; }
    .main-content { padding-bottom: 20px; }
    
    .sidebar { width: 100%; height: auto; position: fixed; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
    .logo-area { padding: 15px; }
    .logo-area p { display: none; }
    .logo-area h2 { font-size: 1.4rem; }
    
    .nav-menu { 
        position: fixed; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        background-color: #1a237e; 
        display: flex; 
        justify-content: space-around; 
        padding: 10px 0; 
        padding-bottom: max(10px, env(safe-area-inset-bottom)); /* iPhone alt çentik uyumu */
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }
    
    .nav-item { 
        flex-direction: column; 
        padding: 5px; 
        font-size: 0.7rem; 
        border-bottom: none; 
        flex: 1; 
        text-align: center; 
    }
    .nav-item:hover { background-color: transparent; padding-left: 5px; color: white; }
    .nav-icon { margin-right: 0; margin-bottom: 5px; font-size: 1.3rem; display: block;}
}
    
    
    /* İÇERİK ALANI DÜZELTMESİ (Sorunu çözen kısım) */
    .main-content { 
        margin-top: 60px; 
        margin-bottom: 0; /* Margin yerine padding kullanıyoruz ki kaydırma en alta kadar insin */
        padding-bottom: 100px; /* En alttaki kutucuğun menünün altında kalmaması için ekstra boşluk */
    }
    .page-body { padding: 20px; }
    
    .test-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .tema-grid { grid-template-columns: 1fr; }
    .welcome-text { font-size: 1.8rem; }
}