/* 
   KILAVUZ CSS (CONDITIONAL NEUTRAL v2.6)
   - Goal: Absolute fidelity to Database (Html.Raw) content.
   - Mechanism: Only override theme backgrounds if NO inline background is present.
   - Layout: Do NOT touch padding/margins to allow p-3, mb-1 etc. to work.
*/

/* 1. Global Interaction Fix */
html body div[data-legacy-scope="1"] [data-toggle],
html body div[data-legacy-scope="1"] [data-bs-toggle],
html body div[data-legacy-scope="1"] a[href^="#"],
html body div[data-legacy-scope="1"] .card-header,
html body div[data-legacy-scope="1"] .acdn-title,
html body div[data-legacy-scope="1"] .badge-pill,
html body div[data-legacy-scope="1"] .card-link,
html body div[data-legacy-scope="1"] .nav-link {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* 2. Theme Background/Border Neutralizer */
/* We target theme classes but EXCLUDE elements that have inline background styles from DB */
html body div[data-legacy-scope="1"] .card:not([style*="background"]),
html body div[data-legacy-scope="1"] .badge:not([style*="background"]),
html body div[data-legacy-scope="1"] .accordion-item:not([style*="background"]),
html body div[data-legacy-scope="1"] .card-header:not([style*="background"]),
html body div[data-legacy-scope="1"] .card-body:not([style*="background"]),
html body div[data-legacy-scope="1"] .alert:not([style*="background"]),
html body div[data-legacy-scope="1"] .nav-pills:not([style*="background"]),
html body div[data-legacy-scope="1"] .nav-link:not([style*="background"]) {
    background: transparent !important;
    background-color: transparent !important;
}

/* Force-Kill Borders and Shadows that DB never sends - RELAXED for .card */
html body div[data-legacy-scope="1"] .badge,
html body div[data-legacy-scope="1"] .accordion-item,
html body div[data-legacy-scope="1"] .card-header,
html body div[data-legacy-scope="1"] .card-body,
html body div[data-legacy-scope="1"] .alert {
    border: 0 !important;
    box-shadow: none !important;
}

/* 2b. Legacy Card Refinement - Premium */
html body div[data-legacy-scope="1"] .card {
    border: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff !important;
    border-radius: 12px !important;
    margin-bottom: 24px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

html body div[data-legacy-scope="1"] .card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-4px) !important;
}

/* Equal Height Support for Cards in Rows */
html body div[data-legacy-scope="1"] .row {
    display: flex !important;
    flex-wrap: wrap !important;
}

html body div[data-legacy-scope="1"] .row>[class*="col-"] {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 24px !important;
    /* Spacing between rows on mobile */
}

/* Ensure Card Body takes remaining space */
html body div[data-legacy-scope="1"] .card-body {
    flex: 1 1 auto !important;
    padding: 1.5rem !important;
}

/* Reset margin-bottom on the card itself since col- handles it now */
html body div[data-legacy-scope="1"] .row>[class*="col-"] .card {
    margin-bottom: 0 !important;
}

/* 3. Visibility Fix (Standard Bootstrap Behavior) */
html body div[data-legacy-scope="1"] .collapse.show,
html body div[data-legacy-scope="1"] .collapse.in,
html body div[data-legacy-scope="1"] .tab-pane.show,
html body div[data-legacy-scope="1"] .tab-pane.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

html body div[data-legacy-scope="1"] .collapse:not(.show):not(.in),
html body div[data-legacy-scope="1"] .tab-pane:not(.active) {
    display: none !important;
}

/* 4. Layout Alignment Fixes (For 'Günlerin Sıralı Gelmemesi') */
html body div[data-legacy-scope="1"] .nav-item {
    display: inline-block !important;
    /* Ensure buttons stay in line */
    float: none !important;
}

html body div[data-legacy-scope="1"] .nav-pills {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

/* 5. NO ARROWS */
html body div[data-legacy-scope="1"] .acdn-title:after,
html body div[data-legacy-scope="1"] .badge-pill:after,
html body div[data-legacy-scope="1"] .card-header:after {
    display: none !important;
    content: none !important;
}

/* 6. Click/Overlay Fix
   Bazı sayfalarda (özellikle üstteyken) tema katmanları legacy içeriğin üstüne gelebiliyor.
   Bu yüzden legacy wrapper'ı üstte tutuyoruz. */
html body .sayfa-icerik-wrapper[data-legacy-scope="1"] {
    position: relative;
    z-index: 5;
}

html body .sayfa-icerik-wrapper[data-legacy-scope="1"] .nav,
html body .sayfa-icerik-wrapper[data-legacy-scope="1"] .nav-pills,
html body .sayfa-icerik-wrapper[data-legacy-scope="1"] .nav-tabs {
    position: relative;
    z-index: 6;
}

/* 7. Tab/Pill ortalama (Html.Raw içindeki nav) */
html body div[data-legacy-scope="1"] .nav.nav-pills,
html body div[data-legacy-scope="1"] .nav.nav-tabs {
    display: flex !important;
    justify-content: center !important;
    /* ✅ Ortalama */
    flex-wrap: wrap !important;
    width: 100% !important;
    border-bottom: 1px solid rgba(0, 0, 0, .08) !important;
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
}

html body div[data-legacy-scope="1"] .nav.nav-pills .nav-item,
html body div[data-legacy-scope="1"] .nav.nav-tabs .nav-item {
    float: none !important;
}

/* Ek garanti: bazı temalarda `.nav` içindeki alignment bozulabiliyor */
html body .sayfa-icerik-wrapper[data-legacy-scope="1"] ul.nav.nav-pills,
html body .sayfa-icerik-wrapper[data-legacy-scope="1"] ul.nav.nav-tabs {
    justify-content: center !important;
    width: 100% !important;
}

/* 8. Card'ların ortalanması (Html.Raw içindeki kartlar bazen tema tarafından stretch ediliyor) */
html body div[data-legacy-scope="1"] .collapse .card,
html body div[data-legacy-scope="1"] .card.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* force nested legacy wrappers to have no extra padding */
html body div[data-legacy-scope="1"] .single-blog-details,
html body div[data-legacy-scope="1"] .sec-spacer {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 9. Heading Spacing Refinement */
html body div[data-legacy-scope="1"] h1,
html body div[data-legacy-scope="1"] h2,
html body div[data-legacy-scope="1"] h3,
html body div[data-legacy-scope="1"] h4,
html body div[data-legacy-scope="1"] h5 {
    margin-top: 15px !important;
    margin-bottom: 10px !important;
}

html body div[data-legacy-scope="1"]>*:first-child,
html body div[data-legacy-scope="1"]>.single-blog-details:first-child,
html body div[data-legacy-scope="1"]>.sec-spacer:first-child,
html body div[data-legacy-scope="1"] .row:first-child>[class*="col-"]:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Neutralize common bootstrap margin classes if they are at the top */
html body div[data-legacy-scope="1"] .mb-30:first-child,
html body div[data-legacy-scope="1"] .mb-50:first-child {
    margin-top: 0 !important;
}

/* 10. Nav/Tab Spacing */
html body div[data-legacy-scope="1"] .nav.nav-pills,
html body div[data-legacy-scope="1"] .nav.nav-tabs {
    margin-bottom: 15px !important;
    padding-bottom: 0 !important;
}

/* max-width verilmiş kartlarda centering'i garanti et */
html body div[data-legacy-scope="1"] .card[style*="max-width"] {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}