/* Bilecik Avukat & Ulusal Hukuk Portalı - Özel Stil Dosyası */

/* Font ve Temel Tipografi */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=JetBrains+Mono:wght@400;500&display=swap');

html {
    max-width: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    max-width: 100%;
    overflow-x: clip;
    position: relative;
    width: 100%;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Sabit Üst Menü (Sticky Header - Hem PC hem Mobil için Kesintisiz Destek) */
#mainHeader,
.main-nav-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Dokunmatik Cihazlarda Tıklama Gecikmesini (300ms delay) Sıfırlama */
a, button, input, select, textarea {
    touch-action: manipulation;
}

/* Metin Taşması & Kelime Kırılma Koruması */
h1, h2, h3, h4, h5, h6, p, .prose {
    overflow-wrap: break-word;
    word-break: break-word;
}

.font-serif-legal {
    font-family: 'Playfair Display', Georgia, Cambria, 'Times New Roman', serif;
}

.font-mono-doc {
    font-family: 'JetBrains Mono', Courier, monospace;
}

/* Evrensel Medya ve Iframe Esnekliği (Taşma / CLS Önleyici) */
img, svg, video, canvas, audio, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

iframe {
    width: 100% !important;
    max-width: 100% !important;
}

/* iOS Safari Input Otomatik Yakınlaştırma (Auto-Zoom) Önleyici (16px kuralı) */
@media (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Dilekçe Önizleme Kâğıdı (Resmi Evrak Hissi) */
.petition-paper {
    background: #ffffff;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    min-height: 800px;
    padding: 3rem 2.5rem;
    position: relative;
    font-family: 'Times New Roman', Times, serif;
    font-size: 15px;
    line-height: 1.6;
    color: #111827;
}

.petition-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 40px;
    bottom: 0;
    width: 1px;
    background: rgba(226, 232, 240, 0.6);
}

/* Mobil Cihazlarda Dilekçe Kâğıdı Esnekliği */
@media (max-width: 640px) {
    .petition-paper {
        padding: 1.25rem 1rem !important;
        min-height: auto !important;
        font-size: 13.5px !important;
        line-height: 1.5 !important;
    }
    .petition-paper::before {
        display: none !important;
    }
    #petitionPreviewArea {
        font-size: 13px !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
    }
}

/* Yazdırma (Print) CSS - Sayfayı doğrudan A4 dilekçe formatında bastırma */
@media print {
    body * {
        visibility: hidden;
    }
    .petition-paper, .petition-paper * {
        visibility: visible;
    }
    .petition-paper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 2cm 2cm;
        box-shadow: none;
        border: none;
    }
    .petition-paper::before {
        display: none;
    }
    .no-print {
        display: none !important;
    }
}

/* Özel Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Tablo ve Yatay Kaydırma Desteği */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

.prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}

@media (max-width: 640px) {
    table th, table td {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Kart Hover Efektleri */
.card-hover-effect {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover-effect:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.1);
}

/* AdSense Alanları için CLS ve Taşma Önleyici */
.ad-slot-wrapper {
    contain: layout;
    max-width: 100% !important;
    overflow: hidden !important;
}

.ad-slot-wrapper ins,
.ad-slot-wrapper iframe {
    max-width: 100% !important;
}

/* Hesaplama Tablosu Animasyonu */
@keyframes fadeInResult {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-result {
    animation: fadeInResult 0.35s ease-out forwards;
}

/* İndirme Geri Sayım Progress Bar */
.countdown-progress {
    transition: width 1s linear;
}

/* Mavidamla Varsayılan Kutusunu Gizleme */
[data-mavidamla-sayac] {
    display: none !important;
}

/* Canlı Ziyaretçi & 5651 Trafik Gösterge Kutusu (Yüksek Özgüllük & Kontrast) */
.zo-wrap {
    contain: content;
}
.zo-kart {
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.zo-kart:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.4) !important;
}
.zo-val {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.zo-lbl {
    color: #94a3b8 !important;
}

@media (max-width: 380px) {
    .zo-kart {
        padding: 0.65rem !important;
    }
    .zo-val {
        font-size: 1.15rem !important;
    }
}

/* Sabit Alt Bar (Sticky Bottom) Alan Boşluğu & iOS Güvenli Alan Desteği */
body {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
}
@media (min-width: 768px) {
    body {
        padding-bottom: 0px !important;
    }
}

#stickyBottomAd {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* Küçük Ekranlar (iPhone SE, 320px-360px) Mikro Düzeltmeleri */
@media (max-width: 360px) {
    .zo-kart {
        padding: 0.5rem !important;
    }
    .zo-val {
        font-size: 1rem !important;
    }
    h1 {
        font-size: 1.5rem !important;
        line-height: 1.25 !important;
    }
}
