/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Patrick+Hand&display=swap');

:root {
    --primary: #4f46e5;
    --paper-width: 210mm;
    --paper-height: 297mm;
}

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

.font-hand {
    font-family: 'Patrick Hand', cursive; /* El yazısı hissi veren başlık fontu */
}

/* Sınıf Butonları */
.grade-btn {
    padding: 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.grade-btn:hover { background: #e2e8f0; }
.grade-btn.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* İşlem Butonları */
.op-btn {
    padding: 12px;
    border-radius: 12px;
    font-size: 1.5rem;
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.op-btn:hover { background: #e2e8f0; }
.op-btn.active {
    background: #ffffff;
    border-color: #4f46e5;
    color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

/* A4 KAĞIT TASARIMI */
.a4-page {
    width: var(--paper-width);
    height: var(--paper-height);
    padding: 15mm;
    background: white;
    margin: 0 auto;
    box-sizing: border-box;
    /* Ekranda ölçekleme için */
    transform-origin: top center; 
}

/* İŞLEM KUTULARI */
.operation-box {
    font-family: 'Courier New', Courier, monospace; /* Rakamların alt alta gelmesi için monospaced */
    font-weight: bold;
    font-size: 1.6rem;
    line-height: 1.2;
    text-align: right;
    width: 100%;
    padding: 5px;
    break-inside: avoid;
    position: relative;
    z-index: 10;
}

.op-symbol {
    position: absolute;
    left: 0;
    bottom: 8px; /* Çizginin hemen üstü */
}

.op-line {
    border-bottom: 2px solid #000;
    margin-top: 2px;
    margin-bottom: 5px;
}

/* --- BASKI AYARLARI (CRITICAL) --- */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        background: white;
        height: auto;
        overflow: visible;
    }

    /* Sol Paneli Gizle */
    aside, .no-print {
        display: none !important;
    }

    /* Ana Alanı Düzenle */
    main {
        padding: 0;
        margin: 0;
        background: white;
        width: 100%;
        height: 100%;
        overflow: visible;
        display: block;
    }

    /* A4 Kağıdını Tam Sayfa Yap */
    .a4-page {
        width: 100%;
        height: 100%;
        box-shadow: none;
        margin: 0;
        padding: 15mm; /* Baskıda kenar boşluğu */
        transform: none !important; /* Önizleme ölçeğini sıfırla */
    }

    /* Izgara Düzenini Baskıda Koru */
    #operations-grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 2rem 2rem !important; 
    }
}

/* Yan yana bölme işlemi stili */
.division-horizontal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

/* Klasik bölme işlemi (Bakkal Bölmesi) */
.division-classic {
    display: inline-block;
    position: relative;
    text-align: left;
    margin-right: 10px;
}
.div-dividend { float: left; padding-right: 5px; border-right: 2px solid #000; border-bottom: 2px solid #000; }
.div-divisor { float: left; padding-left: 5px; border-bottom: 2px solid #000; }
.div-result { clear: both; padding-left: 5px; color: #ccc; } /* Sonuç boş */