/* ===== LAYOUT SHIFT PREVENTION CSS ===== */
/* This file prevents Cumulative Layout Shift (CLS) by reserving space for dynamic content */

/* ===== NAVIGATION LAYOUT STABILITY ===== */
.main_menu {
    min-height: 60px !important;
    min-width: 600px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
}

.header-center {
    min-height: 60px !important;
    min-width: 600px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
}

/* ===== MENU ITEMS STABILITY ===== */
.menu {
    min-height: 45px !important;
    min-width: 500px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.menu-item {
    min-width: 120px !important;
    height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.menu-item a {
    width: 120px !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    color: #ffffff !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    overflow: visible !important;
    gap: 8px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 10 !important;
}

/* ===== HEADER SECTIONS STABILITY ===== */
.header-left,
.header-right {
    min-width: 200px !important;
    min-height: 60px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

.header-left {
    flex: 0 0 auto !important;
}

.header-right {
    flex: 0 0 auto !important;
}

/* ===== FIXED HEADER HEIGHT ===== */
#header {
    height: 80px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: transparent !important;
    border-bottom: none !important;
    margin-top: 0 !important;
}

.inner-container {
    height: 80px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 20px !important;
    width: 100% !important;
    max-width: none !important;
}

/* ===== SEARCH SECTION STABILITY ===== */
.search-section {
    min-width: 50px !important;
    min-height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

.search-toggle-btn {
    width: 45px !important;
    height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 45px !important;
    min-width: 45px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 16px !important;
    border-radius: 12px !important;
    background: var(--light-blue, #0066cc) !important;
    border: 2px solid var(--accent-blue, #0052a3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-family: 'IRANYekanWeb', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-display: swap !important;
}

/* ===== MOBILE MENU STABILITY ===== */
.mobile-menu-section {
    min-width: 50px !important;
    min-height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: none !important;
}

.av-burger-menu-main {
    width: 45px !important;
    height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    min-width: 44px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 16px !important;
    border-radius: 12px !important;
    background: var(--light-blue, #0066cc) !important;
    border: 2px solid var(--accent-blue, #0052a3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-family: 'IRANYekanWeb', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-display: swap !important;
}

/* ===== LANGUAGE BUTTONS STABILITY ===== */
.social_icons {
    min-width: 150px !important;
    min-height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.lang-btn {
    min-width: 60px !important;
    height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* ===== FONT LOADING STABILITY ===== */
.menu-item a,
.nav-link,
.search-toggle-btn,
.av-burger-menu-main {
    font-family: 'IRANYekanWeb', 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif !important;
    font-display: swap !important;
    contain: layout style paint !important;
}

/* ===== IMAGE LOADING STABILITY ===== */
img, video, canvas, svg {
    max-width: 100% !important;
    height: auto !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
}

/* ===== DYNAMIC CONTENT STABILITY ===== */
.avia-menu {
    min-height: 45px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    display: flex !important;
}

.avia_mega_div {
    min-height: 200px !important;
    contain: layout style paint !important;
    box-sizing: border-box !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: var(--white, #ffffff) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.15)) !important;
    min-width: 250px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1000 !important;
}

/* ===== RESPONSIVE LAYOUT SHIFT PREVENTION ===== */
@media (max-width: 992px) {
    .header-center {
        display: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }
    
    .main_menu {
        min-width: 0 !important;
        min-height: 0 !important;
    }
    
    .menu {
        min-width: 0 !important;
        min-height: 0 !important;
    }
    
    .header-left,
    .header-right {
        min-width: 150px !important;
    }
    
    .av-burger-menu-main {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 99999 !important;
    }
    
    .mobile-menu-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 768px) {
    .header-left,
    .header-right {
        min-width: 100px !important;
    }
    
    .social_icons {
        min-width: 100px !important;
    }
    
    .header-left {
        flex: 1 !important;
    }
    
    .header-right {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        justify-content: flex-end !important;
        margin-right: 15px !important;
    }
    
    .search-section {
        display: none !important;
    }
    
    .mobile-menu-section {
        order: 1 !important;
        margin-left: 0 !important;
    }
    
    .av-burger-menu-main {
        min-width: 60px !important;
        min-height: 60px !important;
        width: 60px !important;
        height: 60px !important;
        background: var(--light-blue, #0066cc) !important;
        border-radius: 12px !important;
        margin: 8px !important;
        padding: 16px !important;
        border: 2px solid var(--accent-blue, #0052a3) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3) !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

@media (min-width: 769px) {
    .av-burger-menu-main {
        display: none !important;
    }
    
    .mobile-menu-section {
        display: none !important;
    }
    
    .header-center {
        display: flex !important;
    }
}

/* ===== FONT LOADING STATES ===== */
.wf-loading {
    visibility: hidden !important;
}

.wf-active,
.wf-inactive {
    visibility: visible !important;
}

/* ===== JAVASCRIPT LOADING STATES ===== */
.js-loading {
    opacity: 0 !important;
}

.js-loaded {
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
}

/* ===== CONTAINER STABILITY ===== */
#header_main {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.container_wrap {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* ===== CSS VARIABLES ===== */
:root {
    --light-blue: #0066cc;
    --accent-blue: #0052a3;
    --white: #ffffff;
    --text-dark: #333333;
    --light-gray: #f8f9fa;
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ===== ACCESSIBILITY COMPLIANCE ===== */
#header .menu-item a {
    min-height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ===== Z-INDEX MANAGEMENT ===== */
#header {
    z-index: 99999 !important;
}

/* ===== HOVER EFFECTS ===== */
.menu-item a:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

.menu-item a:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.menu-item a:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2) !important;
}

.av-burger-menu-main:hover {
    background: var(--accent-blue, #0052a3) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4) !important;
}
