/* GENEL SIFIRLAMALAR VE FONT */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f4f7;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ------------------------------------------- */
/* 🔝 ÜST MENÜ (HEADER) - SABİT */
/* ------------------------------------------- */

.header-sabit {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff; 
    border-bottom: 3px solid #007bff; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000; 
    height: 60px; 
}

.header-ic {
    /* Ana içeriğin maksimum genişliğini belirler */
    max-width: 1200px; 
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.6em;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.arama-ve-butonlar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.arama-input {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 300px;
}

.header-btn {
    padding: 8px 15px;
    border: 1px solid;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* ARA butonu için mavi stil */
.mavi-btn {
    background-color: #007bff; 
    color: white;
    border-color: #007bff;
}

.mavi-btn:hover {
    background-color: #0056b3; 
    border-color: #0056b3;
}

.beyaz-btn {
    background-color: white;
    color: #007bff;
    border-color: #007bff;
}

.beyaz-btn:hover {
    background-color: #007bff;
    color: white;
}

.yesil-btn {
    background-color: white;
    color: #28a745;
    border-color: #28a745;
}

.yesil-btn:hover {
    background-color: #28a745;
    color: white;
}

/* Header'ın kapladığı alan kadar boşluk */
.icerik-offset {
    height: 60px; 
}

/* ------------------------------------------- */
/* ANA İÇERİK YAPISI (Ortadaki Alan) */
/* ------------------------------------------- */

.main-container {
    max-width: 1200px; 
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    flex-grow: 1;
    position: relative;
    
    /* FOOTER YÜKSEKLİĞİNE UYUM İÇİN */
    padding-bottom: 70px; 
    
    /* KRİTİK: Tarayıcı küçüldüğünde yatay kaydırma çubuğu çıkarır, düzeni korur. */
    min-width: 1100px; 
}

.mavi-yazi {
    color: #007bff;
}

/* ------------------------------------------- */
/* SOL SIDEBAR (YAN MENÜ) - STICKY (YAPIŞKAN) */
/* ------------------------------------------- */

.sol-sidebar {
    width: 220px; 
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee; 
    
    /* STICKY POZİSYON: Sayfa kaydırıldığında sabitlenir */
    position: sticky; 
    top: 80px; 
    bottom: 70px; 
    
    height: fit-content; 
    max-height: calc(100vh - 150px); 
    
    display: flex;
    flex-direction: column;
    z-index: 500;
}

/* BAŞLIK GENEL STİLİ (Temizlendi, ikon desteği eklendi) */
.sidebar-baslik {
    flex-shrink: 0;
    margin-top: 0;
    font-size: 1.3em; 
    font-weight: 600;
    color: #007bff; 
    padding: 0 0 10px 0; 
    border-bottom: 2px solid #eee;
    margin-bottom: 10px;
    
    display: flex;
    align-items: center;
}

.sidebar-baslik .sidebar-simge {
    margin-right: 10px;
    font-size: 1.1em;
}

/* YENİ: SAYFA MENÜSÜ KAPSAYICISI (TABLO AYIRICI İŞLEVİ) */
.sayfa-menusu-kapsayici {
    padding: 0 0 10px 0;
    margin-bottom: 15px; /* Marka listesinden ayırma boşluğu */
    border-bottom: 2px solid #007bff; /* MAVİ AYIRICI ÇİZGİ */
}

/* YENİ: BUTON ŞEKLİNDEKİ SAYFA LİNKLERİ */
.sidebar-menu-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 15px;
    margin-bottom: 5px; 
    
    background-color: white; 
    color: #007bff; 
    border: 1px solid #007bff; 
    
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

/* YENİ: HOVER VE AKTİF DURUMU (MAVİ) */
.sidebar-menu-btn:hover,
.sidebar-menu-btn.active {
    background-color: #007bff; 
    color: white; 
    border-color: #007bff;
}


/* MARKA LİSTESİ - KAYDIRMA AYARI */
.marka-listesi {
    flex-grow: 1; 
    overflow-y: scroll; 
    padding-right: 5px; 
    padding-bottom: 5px; 
    min-height: 0; 
}

.marka-listesi ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.marka-listesi li {
    padding: 5px 0;
    border-bottom: 1px dotted #eee;
    font-size: 0.95em;
}

.marka-listesi a {
    text-decoration: none;
    color: #007bff;
    display: flex;
    justify-content: space-between;
    transition: color 0.2s;
}

.marka-listesi a:hover {
    color: #6c757d; 
    font-weight: bold;
}

.adet {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
}

/* ------------------------------------------- */
/* ORTA İÇERİK ALANI (SADECE BURASI KAYACAK) */
/* ------------------------------------------- */
.icerik-alani {
    flex-grow: 1;
    margin: 0 15px; /* Yan panellerle 15px boşluk */
    padding-bottom: 50px; 
    min-width: 600px; 
}

/* DUYURU PANELİ - KRİTİK STICKY (YAPIŞKAN) */
.duyuru-paneli {
    background-color: #fff3cd; 
    color: #856404;
    padding: 10px 15px;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
    
    /* STICKY POZİSYON */
    position: sticky;
    top: 80px; 
    z-index: 100; 
}

.ilan-bolum-baslik {
    font-size: 1.4em;
    color: #007bff;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 15px;
}

.yildiz-simge {
    color: #ffc107; 
    margin-right: 5px;
}

.mavi-simge {
    color: #007bff;
    margin-right: 5px;
}

/* İLAN KARTLARI STİLİ */
.ilan-grid {
    display: grid;
    /* Kartlar arası boşluk 10px tutuldu */
    gap: 10px; 
    margin-bottom: 15px; /* Sayfalama için boşluk bırakıldı */
    grid-template-columns: repeat(3, 1fr); /* Hem anasayfa hem de dinamik sayfalar için 3 sütun */
}

/* KRİTİK: İlan Kartı Yüksekliğini SABİTLEME ve AŞIRI KÜÇÜLTME */
.ilan-card {
    display: flex; 
    flex-direction: column;
    /* Kartın Yüksekliği 140px */
    height: 140px; 
    
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    text-decoration: none; 
    padding: 4px; 
    border: 1px solid #ccc; 
    cursor: pointer;
}

.ilan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Sayfa içeriği değiştiğinde kart sayısının yetersiz kalmasından kaynaklanan boş kartlar için stil */
.bos-kart {
    opacity: 0;
    pointer-events: none; /* Tıklamayı engeller */
    border: none;
    box-shadow: none;
    height: 140px; /* Diğer kartlarla aynı yüksekliği korur */
    background-color: transparent;
}


/* KRİTİK: Görsel Boyutunu ve Oranını SABİTLEME ve AŞIRI KÜÇÜLTME */
.card-image-gercek {
    width: 100%;
    /* Görsel Yüksekliği 80px */
    height: 80px; 
    
    /* Görselin boyutunu bozmadan, belirlenen alana tam oturmasını sağlar (keser) */
    object-fit: cover; 
    
    border-radius: 4px;
    margin-bottom: 2px; 
    flex-shrink: 0; 
}

/* KRİTİK: Kart Metin Alanları - Fontlar da ultra küçültüldü */
.ilan-baslik-mavi {
    margin: 2px 0; 
    text-align: center;
    font-size: 0.8em; 
    font-weight: bold;
    color: #007bff;
    /* Metin alanı taşarsa gizlenir */
    overflow: hidden; 
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.ilan-detay-gri {
    margin: 1px 0; 
    text-align: center;
    font-size: 0.7em; 
    color: #6c757d;
    flex-grow: 1; 
    display: flex; 
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.ilan-fiyat-kirmizi {
    margin: 2px 0 0; 
    text-align: center;
    font-size: 0.8em; 
    font-weight: bold;
    color: #dc3545; 
    flex-shrink: 0;
}

/* ------------------------------------------- */
/* SAYFALAMA VE TÜMÜNÜ GÖR STİLLERİ */
/* ------------------------------------------- */

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 30px; 
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
}

.pagination {
    display: flex;
    gap: 3px;
    padding: 0 10px;
}

.page-link {
    text-decoration: none;
    color: #007bff;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #f0f4f7;
    color: #0056b3;
}

.page-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

/* "Tümünü İncele" butonu */
.tumunu-incele-btn, .anasayfa-don-btn {
    padding: 8px 15px; 
    text-decoration: none;
    font-size: 0.9em;
    margin-right: 10px;
    font-weight: 600;
}


/* ------------------------------------------- */
/* SAĞ PANEL (GİRİŞ & REKLAM) - STICKY (YAPIŞKAN) */
/* ------------------------------------------- */

.sag-panel {
    width: 220px; 
    display: flex;
    flex-direction: column;
    gap: 20px;
    
    /* STICKY POZİSYON */
    position: sticky; 
    top: 80px; 
    bottom: 70px; 
    
    height: fit-content; 
    max-height: calc(100vh - 150px);
    
    z-index: 500;
}

/* GİRİŞ PANELİ */
.login-panel {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    
    display: flex;
    flex-direction: column;
}

.login-baslik {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em; 
    font-weight: 600;
    color: #007bff;
    padding-left: 35px;
    
    background-image: url('assets/uye-giris-simge.avif'); 
    background-repeat: no-repeat;
    background-size: 24px 24px; 
    background-position: 5px center;
}

.login-panel input {
    width: calc(100% - 20px);
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.sifre-unuttum {
    display: block;
    text-align: right;
    font-size: 0.9em;
    text-decoration: none;
    margin-bottom: 15px;
}

.login-button {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
}

.google-giris-btn {
    text-align: center;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #555;
    cursor: pointer;
    font-size: 0.9em;
    background-color: white; 
    transition: all 0.2s;
}

/* KRİTİK: Google Giriş Butonu Hover Rengi Maviye Çevrildi */
.google-giris-btn:hover {
    background-color: #007bff; 
    color: white;
}

.google-giris-btn i {
    color: #db4437; 
    margin-right: 5px;
    font-size: 1.2em; 
}

.google-giris-btn:hover i {
    color: white; 
}

/* REKLAM PANELİ */
.advertisement-panel {
    background-color: #fff3cd; 
    border: 1px solid #ffeeba;
    padding: 20px;
    text-align: center;
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-grow: 1; 
    overflow: hidden; 
}

.advertisement-panel h3 {
    color: #856404;
    margin-top: 0;
}

.reklam-button {
    padding: 8px 15px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.reklam-button:hover {
    background-color: #c82333;
}

/* ------------------------------------------- */
/* ALT BİLGİ (FOOTER) - FIXED SABİTLEME VE TEMAYA UYGUNLUK */
/* ------------------------------------------- */
.alt-bilgi {
    text-align: center;
    
    /* Yükseklik içeriğe göre otomatik ayarlanır */
    padding: 5px 10px; 
    
    background-color: #0056b3; 
    color: white;
    font-size: 0.8em; 
    
    /* SABİT POZİSYON */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999; 
    
    border-top: 2px solid #003d80; 
}