/* ===== FONT DISPLAY OPTIMIZATION ===== */
/* Fallback font definitions for better FOIT prevention */
@font-face {
    font-family: 'Montserrat';
    font-display: swap;
    font-weight: 400 700;
    font-style: normal;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Open Sans';
    font-display: swap;
    font-weight: 400 600;
    font-style: normal;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Font loading performance optimization */
.font-loading {
    font-display: swap;
    text-rendering: optimizeSpeed;
}

/* Prevent layout shift during font loading */
body {
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Explicit font fallbacks for better FOIT prevention */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
}

body, p, span, div, a, li, td, th {
    font-family: var(--font-secondary);
}

/* ===== CRITICAL LAYOUT STABILIZATION ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--dark-gray);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== LAYOUT SHIFT PREVENTION ===== */
.layout-stable {
    contain: layout style paint;
    will-change: transform;
}

.container-stable {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    contain: layout style paint size !important;
    transform: translateZ(0) !important;
    will-change: auto !important;
    /* Enhanced layout stability */
    min-height: auto;
    padding-left: 15px;
    padding-right: 15px;
    /* Force hardware acceleration for stability */
    backface-visibility: hidden;
    /* Additional CLS prevention */
    position: relative !important;
    isolation: isolate !important;
}

/* Enhanced container stability for different screen sizes */
@media (min-width: 576px) {
    .container-stable { max-width: 540px !important; }
}

@media (min-width: 768px) {
    .container-stable { max-width: 720px !important; }
}

@media (min-width: 992px) {
    .container-stable { max-width: 960px !important; }
}

@media (min-width: 1200px) {
    .container-stable { max-width: 1140px !important; }
}
/* ===== LAYOUT SHIFT PREVENTION - NAVBAR FIX ===== */
/* Navbar layout shift fix */
.navbar-nav {
    contain: layout style;
    will-change: auto;
}


@media (min-width: 1400px) {
    .container-stable { max-width: 1320px !important; }
}

/* Layout Containment Güçlendirme */
.container-stable * {
    contain: layout style !important;
}

.hero-stable {
    min-height: 80vh;
    contain: layout style;
}

@media (max-width: 767.98px) {
    .hero-stable {
        min-height: 70vh;
    }
}

@media (min-width: 1200px) {
    .hero-stable {
        min-height: 85vh;
    }
}

.section-stable {
    min-height: 400px;
    contain: layout;
}

.card-stable {
    min-height: 300px;
    contain: layout style;
}

.image-stable {
    aspect-ratio: attr(width) / attr(height);
    object-fit: cover;
    contain: layout style;
}

/* ===== CUSTOM CSS VARIABLES ===== */
:root {
    --primary-color: #1e3a8a;
    --secondary-color: #f97316;
    --dark-gray: #64748b;
    --light-gray: #f8fafc;
    --white: #ffffff;
    --black: #000000;
    
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--dark-gray);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--dark-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CUSTOM BOOTSTRAP OVERRIDES ===== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: #1e40af;
    border-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* ===== NAVIGATION ===== */
.navbar {
    padding: 1rem 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    min-height: 76px;
    height: 76px;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    transition: var(--transition);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--primary-color) !important;
    margin: 0 10px;
    padding: 8px 16px !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: var(--light-gray);
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    padding: 10px 0;
}

.dropdown-item {
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    min-height: 80vh;
    height: auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    overflow: visible;
    contain: layout style paint;
    will-change: transform;
    padding: 120px 0 80px;
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: 70vh;
        padding: 100px 0 60px;
    }
}

@media (min-width: 768px) {
    .hero-section {
        min-height: 80vh;
        padding: 120px 0 80px;
    }
}

@media (min-width: 1200px) {
    .hero-section {
        min-height: 85vh;
        padding: 140px 0 100px;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 138, 0.1);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 10;
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    
    /* ✅ Font Loading Optimizasyonu */
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-display: swap; /* FOIT önleme */
    font-size-adjust: 0.5; /* Font fallback boyut uyumu */
    
    /* ✅ Layout Shift Prevention */
    min-height: 180px; /* Desktop için yeterli yükseklik */
    
    /* ✅ CSS Containment Optimizasyonu */
    contain: none; /* Agresif containment kaldır */
    will-change: auto; /* Gereksiz optimizasyon kaldır */
    
    /* ✅ Visibility Garantisi */
    visibility: visible !important;
    opacity: 1 !important;
    
    /* ✅ Anti-FOIT Measures */
    text-rendering: optimizeSpeed; /* Hızlı render */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* ✅ Forced Visibility */
    display: block !important;
    
    /* ✅ Text Overflow Düzeltmeleri (mevcut olanları koru) */
    max-width: 100%;                            /* Container sınırlarına tam uyum */
    word-wrap: break-word;                      /* Kelime sarma aktif */
    overflow-wrap: break-word;                  /* Modern tarayıcı desteği */
    overflow: visible;                          /* Metin kesme önle */
    
    /* Mevcut özellikler korundu */
    hyphens: auto;                              /* Otomatik tire ekleme */
    white-space: normal;                        /* Normal metin akışı */
    text-rendering: optimizeLegibility;         /* Daha iyi metin görünümü */
    display: block;                             /* Block element */
    width: 100%;                                /* Tam genişlik */
    
    /* Force hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.hero-subtitle {
    font-size: 1.4rem;
    line-height: 1.7;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    margin-bottom: 3rem;
    margin-left: auto;
    margin-right: auto;
    
    /* ✅ Genişlik Düzeltmeleri */
    max-width: 100%;                            /* 800px kısıtlaması kaldır */
    
    /* ✅ Yükseklik Düzeltmeleri */
    height: auto;                               /* Dinamik yükseklik */
    
    /* ✅ Text Overflow Özellikleri Ekle */
    word-wrap: break-word;                      /* Kelime sarma */
    overflow-wrap: break-word;                  /* Modern tarayıcı desteği */
    white-space: normal;                        /* Normal metin akışı */
    overflow: visible;                          /* Metin kesme önle */
    
    /* Mevcut özellikler korundu */
    hyphens: auto;                              /* Otomatik tire ekleme */
    text-rendering: optimizeLegibility;         /* Daha iyi metin görünümü */
    display: block;                             /* Block element */
    width: 100%;                                /* Tam genişlik */
}

.hero-buttons {
    position: relative;
    z-index: 2;
    margin-top: 2rem;
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
        line-height: 1.6;
    }
    
    .hero-buttons {
        margin-top: 1.5rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
        margin-bottom: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
        margin-bottom: 2.8rem;
    }
}

@media (min-width: 1200px) {
    .hero-title {
        font-size: 4rem;
        margin-bottom: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
        margin-bottom: 3.5rem;
    }
    
    .hero-buttons {
        margin-top: 2.5rem;
    }
}

.text-primary {
    color: var(--secondary-color) !important;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator a {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ===== FEATURE CARDS ===== */
.feature-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(30, 58, 138, 0.1);
    min-height: 320px;
    height: 320px;
    contain: layout style;
    will-change: transform;
}

@media (min-width: 768px) {
    .feature-card {
        min-height: 350px;
        height: 350px;
    }
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--white);
    font-size: 2rem;
}

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-card p {
    color: var(--dark-gray);
    line-height: 1.6;
}

/* ===== SERVICE CARDS ===== */
.service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(30, 58, 138, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 380px;
    height: 380px;
    contain: layout style;
    will-change: transform;
}

@media (min-width: 768px) {
    .service-card {
        min-height: 420px;
        height: 420px;
    }
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--white);
    font-size: 1.8rem;
}

.service-card h4 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-card p {
    color: var(--dark-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.service-list li {
    padding: 8px 0;
    color: var(--dark-gray);
    position: relative;
    padding-left: 20px;
}

.service-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.cta-card {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: var(--white);
    text-align: center;
}

.cta-card h4,
.cta-card p {
    color: var(--white);
}

.cta-card .service-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== STATS SECTION ===== */
.stat-item {
    padding: 2rem 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, #1f2937, #111827) !important;
}

footer h5 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
}

footer ul li a:hover {
    color: var(--secondary-color);
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feature-card,
    .service-card {
        margin-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .hero-buttons .btn:last-child {
        margin-bottom: 0;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .navbar-nav {
        text-align: center;
        padding-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        margin: 5px 0;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .feature-card,
    .service-card {
        padding: 2rem 1.5rem;
        min-height: 280px;
        height: 280px;
    }
    
    .feature-icon,
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* ===== ADDITIONAL CLS PREVENTION STYLES ===== */
/* ADIM 3: Content Section Stabilization */

/* Hero Section Stabilization */
.hero {
    min-height: 500px;
}

/* Content Container Stabilization */
.container {
    min-height: 200px;
}

.section {
    min-height: 300px;
}

/* Card Elements Stabilization */
.card, .service-card, .discipline-card, .sector-card {
    min-height: 250px;
}

.page-header {
    min-height: 250px;
    height: 250px;
    contain: layout style;
}

.navbar {
    min-height: 76px;
    height: 76px;
    contain: layout style;
}

.navbar .container {
    min-height: 76px;
    height: 76px;
}

.navbar-brand img {
    width: 120px;
    height: 60px;
    object-fit: contain;
}

/* Section stabilization */
.py-5 {
    min-height: 400px;
    contain: layout;
}

.bg-light {
    min-height: 450px;
}

/* Footer stabilization */
footer {
    min-height: 300px;
    contain: layout style;
}

/* Image stabilization */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.img-fluid {
    aspect-ratio: attr(width) / attr(height);
    object-fit: cover;
}

/* Form stabilization */
.contact-form-wrapper {
    min-height: 600px;
    contain: layout;
}

.contact-info-card {
    min-height: 200px;
    height: 200px;
    contain: layout style;
}

/* Process and methodology cards */
.process-card,
.methodology-card,
.mvv-card,
.capability-card,
.discipline-card,
.sector-card {
    min-height: 300px;
    height: 300px;
    contain: layout style;
    will-change: transform;
}

@media (min-width: 768px) {
    .process-card,
    .methodology-card,
    .mvv-card,
    .capability-card,
    .discipline-card,
    .sector-card {
        min-height: 350px;
        height: 350px;
    }
}

/* Breadcrumb stabilization */
.breadcrumb {
    min-height: 40px;
    contain: layout;
}

/* Button stabilization */
.btn {
    min-height: 44px;
    contain: layout style;
}

.btn-lg {
    min-height: 50px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

/* ===== PAGE HEADER ===== */
.page-header {
    position: relative;
    background: linear-gradient(rgba(30, 58, 138, 0.8), rgba(30, 64, 175, 0.8)), url('../images/page-header-bg.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 300px;
    display: flex;
    align-items: center;
}

/* ===== UTILITY CLASSES ===== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) 1;
}

/* ===== LOADING ANIMATION ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== FOOTER LOGO STYLING ===== */
/* Footer logo beyazlaştırma - koyu arkaplan ile uyumluluk için */
.footer .navbar-brand img,
footer .navbar-brand img,
.bg-dark .navbar-brand img,
footer img[alt*="Logo"],
footer img[alt*="logo"],
.bg-dark img[alt*="Logo"],
.bg-dark img[alt*="logo"] {
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

/* Footer logo hover efekti */
.footer .navbar-brand img:hover,
footer .navbar-brand img:hover,
.bg-dark .navbar-brand img:hover,
footer img[alt*="Logo"]:hover,
footer img[alt*="logo"]:hover,
.bg-dark img[alt*="Logo"]:hover,
.bg-dark img[alt*="logo"]:hover {
    filter: brightness(0) invert(1) opacity(0.8);
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
/* ===== CLS PREVENTION ENHANCEMENTS ===== */
/* Critical CSS for layout stability */

/* Prevent layout shift during font loading */
@font-face {
    font-family: 'Montserrat-Fallback';
    font-display: swap;
    src: local('Arial'), local('Helvetica'), local('sans-serif');
    size-adjust: 100%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'OpenSans-Fallback';
    font-display: swap;
    src: local('Arial'), local('Helvetica'), local('sans-serif');
    size-adjust: 100%;
    ascent-override: 92%;
    descent-override: 24%;
    line-gap-override: 0%;
}

/* Global layout stability */
* {
    /* Prevent micro layout shifts */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* AOS Animation CLS Prevention */
[data-aos] {
    /* Reserve space before animation */
    contain: layout style;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Prevent layout shift during image loading */
img {
    /* Reserve aspect ratio */
    height: auto;
    max-width: 100%;
    /* Prevent layout shift */
    contain: layout;
}

/* Hero section stability */
.hero-section {
    /* Explicit height to prevent shift */
    min-height: 100vh;
    contain: layout style paint;
    will-change: auto;
}

/* Bootstrap container override for stability */
.container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
    contain: layout;
    will-change: auto;
}
