/* MEDYAJANS Z-INDEX HIERARCHY SYSTEM */
/* Tüm sistemlerde tutarlı z-index değerleri */

:root {
    /* Z-Index Hierarchy */
    --z-index-base: 1;
    --z-index-dropdown: 10;
    --z-index-sticky: 100;
    --z-index-header: 500;
    --z-index-overlay: 1000;
    --z-index-modal: 2000;
    --z-index-popup: 3000;
    --z-index-toast: 4000;
    --z-index-info-panel: 5000;
    --z-index-critical: 9000;
}

/* Header Systems */
.header-outer-container,
#companyHeaderContainer,
.company-system-header {
    z-index: var(--z-index-header) !important; /* 500 */
}

/* Modal Systems */
.modal-overlay,
.modal-backdrop {
    z-index: var(--z-index-modal) !important; /* 2000 */
}

.modal,
.modal-container {
    z-index: calc(var(--z-index-modal) + 1) !important; /* 2001 */
}

/* Popup Systems */
.popup-overlay {
    z-index: var(--z-index-popup) !important; /* 3000 */
}

.popup-container {
    z-index: calc(var(--z-index-popup) + 1) !important; /* 3001 */
}

/* Toast Systems */
.toast-container {
    z-index: var(--z-index-toast) !important; /* 4000 */
}

.toast {
    z-index: calc(var(--z-index-toast) + 1) !important; /* 4001 */
}

/* System Toast (Daha yüksek) */
.system-toast-backdrop {
    z-index: calc(var(--z-index-toast) + 100) !important; /* 4100 */
}

.system-toast {
    z-index: calc(var(--z-index-toast) + 101) !important; /* 4101 */
}

/* Settings Modal (En üst modaller) */
.settings-modal-overlay {
    z-index: calc(var(--z-index-toast) + 200) !important; /* 4200 */
}

.settings-modal {
    z-index: calc(var(--z-index-toast) + 201) !important; /* 4201 */
}

/* Critical Systems (Debug, Error screens) */
.debug-overlay,
.error-screen,
.loading-screen {
    z-index: var(--z-index-critical) !important; /* 9000 */
}

/* Mobile Specific Fixes */
@media (max-width: 768px) {
    /* Mobilde z-index değerleri aynı kalır */
    /* Viewport rendering sorunlarını önlemek için transform'lar eklenir */
    
    .toast-container {
        transform: translateZ(0); /* Hardware acceleration */
        will-change: transform; /* Performance hint */
    }
    
    .modal {
        transform: translateZ(0);
        will-change: transform;
    }
    
    .popup-container {
        transform: translateZ(0);
        will-change: transform;
    }
    
    /* Mobile viewport fixes */
    .toast-container,
    .modal-overlay,
    .popup-overlay {
        position: fixed !important; /* Mobilde position fixed gerekli */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none; /* Container'a click geçmez */
    }
    
    .toast,
    .modal,
    .popup-container {
        pointer-events: auto; /* İçerik click alır */
    }
}

/* Debug: Z-Index görünürlüğü için */
.debug-z-index {
    position: relative;
}

.debug-z-index::before {
    content: "z:" attr(data-z-index);
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    z-index: 9000; /* Debug level - critical */
}