/* === PERFORMANCE OPTIMALIZÁLÁS === */

/* Csökkenti a reflow-okat és repaint-eket */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU gyorsítás kritikus animációkhoz */
.info-card, .property-card, .legacy-card, .difference-card,
.element-card, .indian-element-card, .philosopher-card,
.journey-card, .atom-model, .nucleus, .orbit, .electron {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth scroll minden böngészőben */
html {
    scroll-behavior: smooth;
}

/* Reduced motion támogatás - hozzáférhetőség */
@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;
    }
}

/* Touch eszközök optimalizálása */
@media (hover: none) and (pointer: coarse) {
    .info-card:hover,
    .property-card:hover,
    .journey-card:hover {
        transform: scale(1.02) !important;
    }
}

/* Print stílusok */
@media print {
    .navbar,
    .footer,
    canvas,
    [data-parallax] {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode támogatás (opcionális) */
@media (prefers-color-scheme: dark) {
    /* Kommenteld ki ha szeretnéd aktiválni */
    /*
    body {
        background: #1a1a2e;
        color: #eee;
    }
    
    .navbar {
        background: rgba(26, 26, 46, 0.95);
    }
    
    .info-card, .property-card, .philosopher-card {
        background: #16213e;
        color: #eee;
    }
    */
}

/* Preload animációk teljesítmény javítása */
@keyframes preload {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.page-loaded {
    animation: preload 0.5s ease-in;
}

/* Lazy load képek placeholder */
img[loading="lazy"] {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Scroll snap finomhangolás */
.timeline-modern::-webkit-scrollbar,
.properties-grid::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.timeline-modern::-webkit-scrollbar-track,
.properties-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.timeline-modern::-webkit-scrollbar-thumb,
.properties-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.timeline-modern::-webkit-scrollbar-thumb:hover,
.properties-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Fokozott kontrast mód */
@media (prefers-contrast: high) {
    * {
        border-width: 2px !important;
    }
    
    .neon-text {
        animation: none !important;
        text-shadow: none !important;
        color: #000 !important;
    }
}

/* Canvas teljesítmény optimalizálás */
canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
