/*
  CORE WEB VITALS OPTIMIZED CSS
  ==============================
  Critical performance optimizations for LCP, CLS, INP
*/

/* CLS PREVENTION - Layout Stability */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Reserve space for images to prevent CLS */
img:not([width]):not([height]) {
    aspect-ratio: 16/9; /* Default aspect ratio */
}

/* LCP OPTIMIZATION - Above the fold content */
.logo-img {
    width: 120px !important;
    height: 40px !important;
    object-fit: contain;
}

/* Modern loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* INP OPTIMIZATION - Interaction feedback */
button, a, [role="button"] {
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Font display swap for web fonts */
@font-face {
    font-family: 'Inter';
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
}

/* Critical above-the-fold styles */
.modern-header {
    contain: layout style;
    will-change: auto;
}

.logo-wrapper {
    contain: layout;
}

/* Optimize rendering */
body.loaded .modern-header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ad space reservation to prevent CLS */
.topReklam {
    min-height: 90px; /* Reserve space for ads */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Performance optimization for animations */
.modern-header,
.logo-wrapper,
.nav-tab {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Lazy loading optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Critical resource hints visual feedback */
.resource-loading {
    position: relative;
}

.resource-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Modern scrollbar for better UX */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(59,130,246,0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59,130,246,0.7);
}
