/* ==========================================================================
   MAVİOKUL ÖDEV MOTORU - ANA TASARIM DOSYASI (style.css)
   ========================================================================== */

/* --- 1. GENEL AYARLAR --- */
* {
    box-sizing: border-box;
    font-family: 'Quicksand', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
}

/* --- 2. YÖNETİM PANELİ (EKRAN TASARIMI) --- */
#setup-page {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

.main-header {
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.main-header span {
    color: #3498db;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.glass-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #34495e;
    font-size: 14px;
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #dfe6e9;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
    outline: none;
    transition: all 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: #3498db;
}

.icon-picker {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.icon-opt {
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: 0.2s;
}

.icon-opt.selected {
    border-color: #3498db;
    background-color: #ebf5fb;
}

.btn-generate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
}

/* ==========================================================================
   3. YAZDIRMA EKRANI KONTROLÜ (KAYMA SORUNUNU ÇÖZEN KISIM)
   ========================================================================== */
@media screen {
    #print-area { display: none !important; }
}

@media print {
    @page { 
        size: A4; 
        margin: 0; /* Tarayıcı boşluklarını sıfırlar */
    }
    
    body { 
        margin: 0 !important; 
        padding: 0 !important; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact; 
        background: white;
    }
    
    #setup-page { display: none !important; }
    
    #print-area { 
        display: block !important; 
        width: 100%; 
        margin: 0 !important; 
        padding: 0 !important; 
    }
    
    .page {
        margin: 0 !important; /* İlk sayfadaki kaymayı engeller */
        box-shadow: none !important; 
        border: none !important;
    }
}

/* ==========================================================================
   4. A4 KAĞIDI VE İÇERİK TASARIMI
   ========================================================================== */

#print-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page {
    width: 210mm;
    height: 297mm; 
    background: white;
    margin: 20px auto; /* Ekranda ortalı görünür, yazıcıda sıfırlanır */
    padding: 12mm 15mm; 
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    page-break-after: always;
    overflow: hidden; 
    position: relative; /* İmza için gerekli */
    padding-bottom: 20mm !important; /* İmza boşluğu */
}

/* --- YENİ FERAH BAŞLIK KUTUSU --- */
.header-box {
    display: flex;
    flex-direction: column; 
    border: 3px solid #2c3e50;
    border-radius: 10px;
    padding: 12px 20px; 
    margin-bottom: 8mm; 
    background-color: #fff;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center; 
    border-bottom: 2px dashed #bdc3c7; 
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.h-icon {
    font-size: 34px;
    margin-right: 15px;
}

.h-content {
    text-align: center;
}

.h-content h2 {
    margin: 0;
    font-size: 20px !important;
    font-weight: 900;
    letter-spacing: 1px;
    color: #2c3e50;
}

.header-bottom {
    display: flex;
    justify-content: space-between; 
    font-size: 14px;
    font-weight: 800;
    color: #34495e;
    padding: 0 15px;
}

/* Atakan BAYLAM İmza Tasarımı */
.page-footer {
    position: absolute;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: #7f8c8d;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ==========================================================================
   5. IZGARA VE SORU TASARIMLARI
   ========================================================================== */

.task-grid-container {
    flex-grow: 1; 
    width: 100%;
}






.grid-1col-kareli { display: grid; grid-template-columns: 1fr; gap: 20px; }







.card {
    border: 2px solid #ccc;
    border-radius: 8px;
    position: relative;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    break-inside: avoid; 
}

.q-no {
    position: absolute;
    top: -12px;
    left: -12px;
    color: white;
    width: 26px;
    height: 26px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: 900;
    font-size: 13px;
    z-index: 2;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

/* KARELİ İZGARA (5x6 = 30 Soru) */
.grid-kare-izgara {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(6, 1fr) !important; 
    gap: 8px !important; 
}

.grid-kare-izgara .card {
    height: 100%;
    margin: 0 !important;
    background-color: #ffffff !important;
    background-image: 
        linear-gradient(#d1d8e0 1px, transparent 1px),
        linear-gradient(90deg, #d1d8e0 1px, transparent 1px) !important;
    background-size: 16px 16px !important;
    background-position: center top !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.grid-kare-izgara .task-content {
    transform: scale(0.92); 
    transform-origin: center center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3 SÜTUNLU TASARIM (3x11 = 33 Soru) */
.grid-3col-tight {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(11, 1fr) !important; 
    gap: 8px !important;
}

.grid-3col-tight .card {
    height: 100%;
    margin: 0 !important;
    background-color: #ffffff !important;
    background-image: 
        linear-gradient(#d1d8e0 1px, transparent 1px),
        linear-gradient(90deg, #d1d8e0 1px, transparent 1px) !important;
    background-size: 16px 16px !important;
    background-position: center top !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.grid-3col-tight .task-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2 SÜTUNLU TASARIM (2x11 = 22 Soru) */
.grid-2col-kareli {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(11, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    height: 100% !important;
}

.grid-2col-kareli .card {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #ffffff !important;
    background-image: 
        linear-gradient(#d1d8e0 1px, transparent 1px), 
        linear-gradient(90deg, #d1d8e0 1px, transparent 1px) !important;
    background-size: 16px 16px !important;
    background-position: center top !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.grid-2col-kareli .task-content {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}




/* ==========================================================================
   MOBİL UYUMLULUK (RESPONSIVE TASARIM) - TELEFON VE TABLETLER İÇİN
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    /* Ana çerçeveyi ekrana sığdır ve kenarlardan boşluk ver */
    #setup-page {
        margin: 10px auto !important;
        padding: 15px !important;
        width: 95% !important;
        box-sizing: border-box;
    }

    /* Başlık boyutunu telefona göre küçült */
    .main-header {
        font-size: 26px !important;
        text-align: center;
        margin-bottom: 20px;
    }

    /* 3'lü kart sistemini yan yana değil, ALT ALTA diz */
    .dashboard-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    /* Kartların taşmasını engelle */
    .glass-card {
        width: 100% !important;
        box-sizing: border-box;
        padding: 20px 15px !important;
    }

    /* İkonları ekrana sığacak şekilde sar (wrap) */
    .icon-picker {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    /* Kutuların (input/select) ekrandan taşmasını kesin olarak engelle */
    .input-group input[type="text"], 
    .input-group input[type="number"], 
    .input-group select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Oluştur butonunu tam ekran yap ve parmakla basmaya uygun hale getir */
    .btn-generate {
        width: 100% !important;
        font-size: 16px !important;
        padding: 18px 10px !important;
        white-space: normal !important;
        margin-top: 10px;
    }
}


/* ==========================================================================
   YAZDIRMA (PRINT) EKRANI AYARLARI - NÜKLEER SEÇENEK (KESİN ÇÖZÜM)
   ========================================================================== */
@media print {
    /* KURAL 1: Body içindeki #print-area HARİÇ her şeyi (Google Reklamları dahil) zorla gizle! */
    body > *:not(#print-area) {
        display: none !important;
    }

    /* KURAL 2: İnatçı Google iframe ve ins etiketlerini ekstra olarak yokediyoruz */
    ins, iframe, .adsbygoogle {
        display: none !important;
    }

    /* KURAL 3: Sadece çıktı kağıdımızı görünür ve tam sayfa yap */
    #print-area {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* KURAL 4: Arka planı bembeyaz ve sıfır boşluklu yap */
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}