/* Performance Optimization CSS */

/* Critical CSS for above-the-fold content */
.above-fold {
    contain: layout style paint;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(#f0f0f0 50%, transparent 50%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px;
}

/* Hide all alt text for better UX */
img {
    color: transparent !important;
    text-indent: -9999px;
    overflow: hidden;
}
 
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimize font loading */
@font-face {
    font-family: 'Poppins';
    font-display: swap;
    src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
}

/* Fix image aspect ratios */
.news-thumbnail {
    aspect-ratio: 1.5; /* Match actual aspect ratio (1.50) */
    object-fit: cover;
    width: 90px;
    height: 60px; /* 90/1.5 = 60 */
}

 
/* Fix banner images aspect ratio - Keep original size */
.banner-img {
    aspect-ratio: 3.33; /* Use most common banner ratio */
    object-fit: fill !important;
    min-width: 300px;
    max-width: 100%;
    max-height: 60px;
    display: block !important; /* Just prevent shift, keep original size */
    /* Reserve space to prevent shift */
    min-height: 60px;
}

/* Header banner specific styling */
.header-ads .banner-img {
    min-height: auto !important;
    height: auto;
    min-width: auto !important;
    width: 100%;
    object-fit: contain  !important;
}

 

/* Fix logo images - prevent layout shift without changing size */
img[src*="logo.webp"], img[alt="logo"] {
    object-fit: contain !important;
    display: block !important;
    height: 80px !important;
    min-width: 150px !important;
    min-height: 80px !important;
    max-height: 80px !important;
}

/* Fix main content area layout shift - Reserve space for content */
.main-sec { 
    contain: layout !important;
    /* Reserve space for dynamic content */
    position: relative !important;
    overflow: hidden !important;
}

/* Optimize consultant logos */
.consut-list img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background-color: #f8f9fa;
}

/* Optimize scholarship images */
.uni-img img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Optimize country flags */
.flag-list img {
    width: 50px;
    height: auto;
    object-fit: contain;
}

/* Optimize university icons */
.destination-side img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Optimize city icons */
.city-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: #f0f0f0;
    padding: 10px;
}


/* Fix scholarship section layout shift - Specific targeting without col classes */
div:has(.scholarship-item), div:has([class*="scholarship"]) {
    min-height: 300px !important;
    contain: layout !important;
}

/* Fix university section layout shift - Specific targeting without col classes */
div:has([class*="university"]), div:has([class*="middlesex"]) {
    min-height: 150px !important;
    contain: layout !important;
}

/* Fix footer logo layout shift */
.f-logo img, div.f-logo > a > img {
    width: 150px !important;
    height: 60px !important;
    min-width: 150px !important;
    min-height: 60px !important;
    max-width: 150px !important;
    max-height: 60px !important;
    object-fit: contain !important;
    display: block !important;
}
.main-sec {
    min-height: 80px !important;/* ya jitni jagah uska content hamesha lega */
}
.col-lg-12 {
    min-height: 8px !important;
}
.col-lg-4 {
    min-height: 2px !important;
}


/* Optimize responsive images */
@media (max-width: 768px) {
    .news-thumbnail {
        aspect-ratio: 1.5; /* Keep consistent aspect ratio */
        width: 80px;
        height: 53px; /* 80/1.5 = 53 */
    }
    /* Mobile logo fix */
    img[src*="logo.webp"], img[alt="logo"] {
        width: 120px !important;
        height: 48px !important;
        min-width: 120px !important;
        min-height: 48px !important;
        max-width: 120px !important;
        max-height: 48px !important;
    }

   


    .banner-img {
        aspect-ratio: 3.33;
        max-width: 250px;
        max-height: 75px;
        min-height: auto;
        /* Reserve space on mobile to prevent shift */
        min-width: 150px;
        min-height: 45px;
    }
    
    /* Header banner mobile styling */
    .header-ads .banner-img {
        min-height: auto !important;
        max-height: 30px !important;
        height: 30px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
}

/* Style links without href as buttons */
.banner-link:not([href]),
.slider-link:not([href]) {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
    display: block !important;
}

.banner-link:not([href]):hover,
.slider-link:not([href]):hover {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
}

/* Ensure no pseudo-elements */
.banner-link:not([href])::after,
.slider-link:not([href])::after {
    content: none !important;
}

/* Fix simple banners and university list links - No href styling */
a:not([href]) {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
    display: inline-block !important;
}

a:not([href]):hover {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
}

/* Ensure no underlines on any links */
a {
    text-decoration: none !important;
}

a:hover {
    text-decoration: none !important;
}

 
.side-form label {
     
    font-weight: 600 !important;
}


.btn-top:hover {
    text-decoration: none !important;
}

/* Fix date spans contrast - minimal change */
span {
    font-weight: 500 !important;
}

/* Fix form input contrast - minimal change */
input, select, textarea {
    font-weight: 500 !important;
}

input:focus, select:focus, textarea:focus {
    outline: none !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1) !important;
}

/* Optimize print styles */
@media print {
    .banner-img,
    
    .consut-list {
        display: none !important;
    }
}
