:root {
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f1f5f9;
    --card-bg: #ffffff;
    --danger: #ef4444;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 20px; /* Mobil için kenar boşluğu */
}

/* Kapsayıcı */
.container, .admin-container {
    max-width: 900px;
    margin: 40px auto;
}

/* Admin Bölümleri (Kart Yapısı) */
.admin-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px; /* Bölümler arası net boşluk */
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.admin-section h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Düzeni */
.main-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* İki kolonlu yapı (Masaüstünde yan yana, mobilde alt alta) */
@media (min-width: 768px) {
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Butonlar */
button, .btn {
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover { background: #4338ca; transform: translateY(-1px); }

.btn-secondary { background: var(--text-main); color: white; }

/* Kategori Listesi Tablosu */
.category-table-wrapper {
    overflow-x: auto; /* Mobilde tablonun taşmasını önler */
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

.btn-delete {
    color: var(--danger);
    background: #fef2f2;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
}

.btn-delete:hover { background: var(--danger); color: white; }

/* Blog İçerik Sayfası (Kullanıcı Tarafı) */
.blog-detail {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.main-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 25px 0;
}

.content p {
    text-indent: 30px;
    text-align: justify;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #334155;
}

/* Responsive Grid (Kategoriler için) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cat-card {
    background: white;
    padding: 40px 20px;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    font-weight: bold;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
}

.cat-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    --primary: #2C3E50;
    --accent: #34495E;
    --text-main: #1a202c;
    --text-muted: #718096;
    --bg-body: #f8fafc;
    --white: #ffffff;
    --radius: 12px;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html, body {
    overflow-x: hidden; /* Yatay kaymayı tamamen engeller */
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* Ana Konteynır - Responsive Genişlik */
.container, .admin-container {
    width: 95%;
    max-width: 1100px;
    margin: 120px auto 40px; /* Navbar için boşluk */
    padding: 20px;
}

/* --- KATEGORİ KARTLARI --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.cat-card {
    background: var(--white);
    padding: 40px 20px;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    transition: 0.3s ease;
}

.cat-card:hover {
    transform: translateY(-5px);
    background: var(--primary);
    color: white;
}

/* --- YAZI DETAY --- */
.blog-detail {
    background: var(--white);
    padding: clamp(20px, 5vw, 50px); /* Ekran küçüldükçe iç boşluk azalır */
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.blog-detail h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem); /* Dinamik başlık boyutu */
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.main-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    text-indent: 30px;
    text-align: justify;
    word-wrap: break-word; /* Uzun kelimelerin taşmasını önler */
}

/* --- NAVBAR BUTONU FIX --- */
/* Navbar'ınızın HTML yapısına göre burayı düzenlemelisiniz. 
   Genellikle mobil menü butonu için şu yapı kullanılır: */
.navbar-toggle {
    max-width: 100%;
    overflow: hidden;
}

/* --- MOBİL UYUMLULUK --- */
@media (max-width: 768px) {
    .container {
        margin-top: 100px; /* Mobilde daha az boşluk */
        padding: 10px;
    }

    .content p {
        text-indent: 15px; /* Mobilde girintiyi azalt */
        font-size: 1rem;
        text-align: left; /* Mobilde iki yana yaslama okumayı zorlaştırabilir */
    }

    /* Admin paneli form satırlarını alt alta getir */
    .form-row {
        display: block !important;
    }
    
    input, select, textarea {
        font-size: 16px; /* Mobilde zoom yapmasını engeller */
    }
}


/* Kategori ve Yazı Listesi Başlıkları */
.section-title {
    color: #2C3E50;
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: #2C3E50;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Yazı Listesi Tasarımı */
.post-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.post-item {
    background: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
    border: 1px solid #f0f0f0;
}

.post-item:hover {
    transform: translateX(10px);
    border-color: #2C3E50;
}

.post-item a {
    text-decoration: none;
    color: #2C3E50;
    font-weight: 700;
    font-size: 1.1rem;
    flex: 1;
}

.post-item span {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Geri Dön Butonu */
.back-btn {
    display: inline-block;
    color: #2C3E50;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 20px;
    transition: opacity 0.2s;
}

.back-btn:hover {
    opacity: 0.7;
}

/* Responsive Düzenleme */
@media (max-width: 600px) {
    .post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.btn-secondary {
    background: #34495E;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-block;
}