/* --- GENEL STİLLER --- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6; /* Açık gri arka plan */
    color: #34495e;
    line-height: 1.6;
}

/* Tüm içeriği kapsayacak ana esnek düzen */
.main-container {
    display: flex;
    min-height: 80vh;
    padding: 0;
    margin-left: 10px; /* Sidebar genişliği kadar boşluk bırakır */
    transition: margin-left 0.3s ease;
}

/* --- SOL KENAR ÇUBUĞU (SIDEBAR) STİLLERİ --- */

.sidebar {
    /*position: fixed;  Sabit kalır */
        position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%); /* Mavi Gradient */
    padding: 20px 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-align: center;
}

.sidebar h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 30px;    
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    padding: 0 15px;
}

.menu-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 15px 25px;
    text-align: left;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s, padding-left 0.3s;
}

.menu-item:hover {
    background-color: #2c3e50; /* Koyu Mavi */
    color: white;
    padding-left: 35px;
}

.menu-item.active {
    background-color: #2c3e50;
    color: #2ecc71; /* Vurgu rengi */
    border-left: 5px solid #2ecc71;
    padding-left: 30px;
    font-weight: 600;
}

/* --- ANA İÇERİK (CONTENT) STİLLERİ --- */

.content {
    flex-grow: 1;
    width: 100%;       /* Küçük ekranlarda tam genişlik */
    max-width: 1200px; /* Büyük ekranlarda 1200px'den fazla büyüme */
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.content h3 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
    text-align: center;
}

.content-generate {
    width: 1000px;
    flex-grow: 1;
    padding: 40px;
    margin: 30px;
    width: 80%;       /* Küçük ekranlarda tam genişlik */
    max-width: 1200px; /* Büyük ekranlarda 1200px'den fazla büyüme */
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.content-generate h3 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
    text-align: center;
}

/* --- FORM STİLLERİ --- */

.section-title {
    font-size: 1.4em;
    color: #3498db;
    margin: 30px 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #bdc3c7;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 sütunlu düzen */
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    background-color: #fcfcfc;
}

.input-box {
    display: flex;
    flex-direction: column;
}

.input-box label {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.input-box input[type="number"],
.input-box select {
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: white;
}

.input-box input:focus,
.input-box select:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* --- KONTROL BUTONLARI --- */

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-top: 1px solid #ecf0f1;
    margin-top: 20px;
}

.generate-btn, .cevap-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.generate-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60); /* Yeşil */
    color: white;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.5);
}

.cevap-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22); /* Turuncu */
    color: white;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.3);
}

.cevap-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(243, 156, 18, 0.5);
}

/* İndirme Butonları Grubu - Butonların Ortak Stili */
.indirme-buttons {
    display: flex; /* Butonları yan yana sıralar */
    gap: 10px;    /* Butonlar arasına boşluk koyar */
}

.indirme-buttons button {
    padding: 8px 15px; /* İç boşluklar */
    border: none;      /* Kenar çizgisini kaldırır */
    border-radius: 5px; /* Köşe yuvarlaklığı */
    font-size: 0.9em;  /* Yazı boyutu */
    cursor: pointer;   /* Fare imlecini işaretçiye çevirir */
    transition: transform 0.2s, opacity 0.3s; /* Animasyon geçişi */
    font-weight: 600;
}

/* Mouse ile üzerine gelindiğinde */
.indirme-buttons button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px); /* Hafif yukarı kayma efekti */
}

/* Buton devre dışı bırakıldığında */
.indirme-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Butonlara Özel Renkler */
.pdf-btn { 
    background-color: #e74c3c; /* Kırmızı arka plan */
    color: white;              /* Beyaz yazı rengi */
} 
.png-btn { 
    background-color: #2ecc71; /* Yeşil arka plan */
    color: white; 
} 
.excel-btn { 
    background-color: var(--tertiary-color); /* Turuncu arka plan */
    color: #34495e;            /* Koyu yazı rengi */
}

/* Çalışma Sayfası Çıktısı */
#worksheet-output {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    min-height: 400px;
}

/* Sayfa Görünümü */
.worksheet-page {
    width: 210mm; /* A4 Genişliği (Basılacak Format) */
    min-height: 297mm; /* Sabit değil, minimum yükseklik yapıyoruz */
    height: auto;      /* İçerik arttıkça otomatik uzasın */
    padding: 25px;
    margin: 25px auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; /* Baskı boyutunu korur */
}

.worksheet-header {
    text-align: center;
    margin-bottom: 30px;
}

.worksheet-header h4 {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
}

.worksheet-header p {
    display: flex;
    margin: 5px 0 0;
    font-size: 0.9em;
    color: #7f8c8d;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* ======================================= */
/* 1. IZGARA TANIMLARI (Grid Definitions) */
/* ======================================= */

/* Varsayılan Izgara: 5 Sütun */
.questions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px; 
    margin: 0;
}

/* 4 Sütunlu Izgara (Kullanıcı Seçimi) */
.questions-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; 
    margin: 0;
}


/* ======================================= */
/* 2. SORU KUTUSU (Question Box) STİLLERİ */
/* ======================================= */

/* Tek Bir Soru Bloğu ve Numarası */
.question-block {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    margin-bottom: 15px;
}

.question-number {
    font-weight: bold;
    color: #34495e;
    font-size: 1em;
    flex-shrink: 0;
    margin-top: 10px;
    width: 25px; 
    text-align: right;
}

/* Tüm Sayfadaki Question Box'lar İçin Ortak/Temel Tanım */
.question-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Tüm içeriği sağa yasla */
    position: relative; 
    margin-top: 5px; 
    
    /* KUTU GÖRÜNÜMÜNÜ SAĞLAYAN TEMEL BORDER */
    border: 1px solid #333; 
    border-radius: 4px; 
    min-height: 80px;
    padding: 5px 10px; 
    width: 90px; 
    box-sizing: border-box; 
}


/* === Sütunlara Özel Kutu Genişlikleri === */

/* 5 Sütun için Kutu Stili (questions-grid içindeki question-box'lar) */
.questions-grid .question-box {
    max-width: 100px; 
    font-size: 20px; 
}

/* 4 Sütun için Kutu Stili (questions-grid-4 içindeki question-box'lar) */
.questions-grid-4 .question-box {
    max-width: 130px; 
    font-size: 22px; 
}

/* ======================================= */
/* 3. ÇIKARMA İŞLEMİ VE CEVAP STİLLERİ */
/* ======================================= */

.sayi1 { 
    margin: 1px 0; 
    font-weight: bold; 
    align-self: flex-end;
    color: #333; /* Siyah sayı */
}

/* Çıkan sayı ve eksi işaretini içeren satır */
.cikan-row {
    display: flex; 
    width: 70px; 
    justify-content: flex-end; 
    margin: 1px 0; 
    font-weight: bold;    
    border-bottom: 2px solid #333; 
    padding-bottom: 5px; 
    margin-bottom: 5px; 
    color: #333;
}

/* Eksi Sembolünün Sola Sabitlenmesi ve Rengi */
.minus-sign {
    position: absolute;
    left: 10px; 
    top: 40px; 
    font-weight: bold;
    font-size: 30px; 
    color: #333;
}

/* Alt Çizgi (Eski .line) - Artık kullanılmıyor */
.line {
    display: none; 
}

/* Cevap Alanı (Boş kutu) */
.answer-box {
    width: 100px; 
    height: 20px;
    text-align: right;
    margin-bottom: 10px;
}

/* Cevap Anahtarı Stili */
.answer-box.answer-key {
    font-size: 0.9em;
    font-weight: bold;
    color: #2ecc71; /* Yeşil cevap rengi */
    text-align: right;
    padding-right: 5px;
    border: none;
}

.pdf-btn, .png-btn, .excel-btn {
    background-color: #e74c3c;
    color: white;
    font-size: 0.9em;
