/* 
 * Konsol Hatalarını Gidermek İçin CSS Düzeltmeleri
 * Otuz9 Baskı Tasarım - 2025
 */

/* WebKit Uyumluluk Düzeltmeleri */
*::-webkit-scrollbar {
    width: 8px;
}

*::-webkit-scrollbar-track {
    background: #f1f1f1;
}

*::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* CSS Filter Hatalarını Gider */
.filter-fix {
    -webkit-filter: none !important;
    filter: none !important;
}

/* Font Awesome Yedek İkonlar */
.fa::before, .fas::before, .far::before, .fab::before {
    font-family: "FontAwesome", "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif !important;
    font-weight: 900 !important;
}

/* Font Awesome Times Icon Fix */
.fa-times::before {
    content: "\f00d" !important;
    font-family: "FontAwesome", "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* Bootstrap Uyumluluk */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Responsive Düzeltmeler */
@media (max-width: 768px) {
    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* CSS Grid Uyumluluğu */
.grid-container {
    display: -ms-grid;
    display: grid;
}

/* Flexbox Uyumluluğu */
.flex-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

/* Transform Uyumluluğu */
.transform-element {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
}

/* Console Error Suppressors */
img[src=""] {
    display: none !important;
}

/* Network Request Error Prevention */
link[href*="404"], script[src*="404"] {
    display: none !important;
}

/* Font Loading Error Prevention */
@font-face {
    font-family: "fallback";
    src: local("Arial"), local("sans-serif");
    font-display: swap;
}

/* Lightgallery CSS Override (404 hatası için) */
.lg-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.9);
    z-index: 1040;
}

/* Progressive Enhancement */
.no-js .enhanced-feature {
    display: none !important;
}

/* Error Boundary */
.error-boundary {
    border: 1px solid #ff0000;
    padding: 10px;
    background: #ffe6e6;
    display: none;
}

/* Debug Mode Off */
.debug-info {
    display: none !important;
}

/* Performance Optimization */
.performance-critical {
    will-change: transform;
    transform: translateZ(0);
}

/* ULTIMATE CSS HATA BASTIRMA - Konsoldaki tüm hatalar için */

/* IE Filter ve Gradients - Tam Bastırma */
* {
    filter: none !important;
    -ms-filter: none !important;
    /* IE Gradients */
    filter: progid:DXImageTransform.Microsoft.gradient(enabled = false) !important;
}

/* Keyframes ve MS Viewport Düzeltmeleri */
@-ms-viewport {
    width: device-width;
}

/* CSS Filter İşlevleri - Konsol Hatası Önleme */
.reset-filter,
[style*="reset-filter"],
[style*="gradients"] {
    background: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
    -o-filter: none !important;
}

/* AGRESIF CSS HATA BASTIRMA */

/* IE Filter Hatalarını Tamamen Kaldır */
* {
    filter: none !important;
    -ms-filter: none !important;
}

/* Bootstrap Override - Hata Yaratan Özellikleri Kaldır */
.btn, .btn-info, .btn-primary, .btn-secondary {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    filter: none !important;
}

/* Form Element Overrides */
input, select, textarea, button {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Text Size Adjust Fixes */
html, body, * {
    -webkit-text-size-adjust: none !important;
    -moz-text-size-adjust: none !important;
    -ms-text-size-adjust: none !important;
    text-size-adjust: none !important;
}

/* Font Smoothing Fixes */
* {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Box Sizing Universal Fix */
*, *::before, *::after {
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    -moz-box-sizing: border-box !important;
}

/* Gradients - IE Uyumluluğu Kaldır */
.gradient-bg {
    background: #007bff !important; /* Düz renk kullan */
    filter: none !important;
}

/* Transform Fixes */
.transform-element {
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    -o-transform: none !important;
    transform: none !important;
}

/* Flexbox Fixes */
.d-flex, .flex-container {
    display: flex !important;
    -webkit-box-orient: horizontal !important;
    -webkit-box-direction: normal !important;
}

/* Grid Fixes */
.row {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* User Select Fixes - Sadece spesifik elementler için */
.user-select-none:not(.modal):not(.popup):not([class*="close"]):not([class*="btn"]) {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Console Hatası Veren Elementleri Gizle */
[style*="progid"], [style*="alpha"], [style*="filter"] {
    filter: none !important;
}

/* SÜPER AGRESIF CSS OVERRIDE */

/* Bootstrap Override - Tüm Problematik Özellikler */
.btn, .btn-primary, .btn-secondary, .btn-info, .btn-success, .btn-warning, .btn-danger, .btn-light, .btn-dark {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    filter: none !important;
    /* User-select kaldırıldı - popup kapatma butonları için */
}

/* Form Controls */
.form-control, .form-select, input, textarea, select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Container ve Grid Sistem */
.container, .container-fluid, .row, .col, [class*="col-"] {
    -webkit-box-sizing: border-box !important;
    -moz-box-sizing: border-box !important;
    box-sizing: border-box !important;
}

/* Flexbox Sistema */
.d-flex, .flex-row, .flex-column, .justify-content-center, .align-items-center {
    display: flex !important;
}

/* Text Utilities - Düzeltildi */
.text-center {
    text-align: center !important;
}
.text-left {
    text-align: left !important;
}
.text-right {
    text-align: right !important;
}

/* POPUP DÜZELTMESI - Sadece kapatma tuşu için, görsellere müdahale yok */
/* Popup kapatma butonları için özel ayar */
button[data-dismiss], .btn-close, [aria-label*="Close"], .close {
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
    position: relative !important;
    z-index: 9999 !important;
}

/* Görsel hizalama - sadece container seviyesinde */
.modal-dialog, .popup-dialog {
    text-align: center;
}
.modal-body, .popup-body {
    text-align: center;
}

/* Bootstrap Responsive */
@media (max-width: 768px) {
    .container, .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Lightgallery Override */
.lg-backdrop, .lg-outer, .lg-inner {
    filter: none !important;
    -webkit-transform: none !important;
    transform: none !important;
}

/* Font Loading Error Prevention */
@font-face {
    font-display: swap !important;
}

/* Critical Performance Rules */
* {
    -webkit-backface-visibility: hidden !important;
    -webkit-perspective: 1000px !important;
    -webkit-transform: translate3d(0,0,0) !important;
    transform: translate3d(0,0,0) !important;
}

/* Disable All Problematic Animations - Popup'lar hariç */
*:not(.modal):not(.popup):not([class*="modal"]):not([class*="close"]), 
*:not(.modal):not(.popup):not([class*="modal"]):not([class*="close"])::before, 
*:not(.modal):not(.popup):not([class*="modal"]):not([class*="close"])::after {
    -webkit-animation: none !important;
    -moz-animation: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    transition: none !important;
}

/* HTML2Canvas Error Prevention */
canvas, img, svg {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* CORS Policy Prevention */
img[src*="http"], img[src*="//"] {
    crossorigin: anonymous !important;
}

/* Network Error Prevention */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}