/* AIWORKS - Optimalizált CSS */

/* === ALAPBEÁLLÍTÁSOK === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Minden elem ne lóghasson ki */
* {
    max-width: 100%;
}

/* Kép optimalizálás - minden kép responsive */
img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* === HÁTTÉR EFFEKTEK === */
.gradient-mesh {
    background: linear-gradient(-45deg, #0a0a0a, #1a1a2e, #16213e, #0f3460);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === ÜVEG EFFEKT === */
.glass-effect {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-white {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === SZÖVEG STÍLUSOK === */
.text-glow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Szöveg olvashatósága - mindig kontrasztos */
.glass-effect,
.gradient-mesh {
    color: #ffffff;
}

.glass-white {
    color: #1a1a2e;
}

/* === NEURÁLIS HÁTTÉR === */
.neural-network {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: brightness(20%);
    background-image: url("https://aiworks.hu/aiworks2.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* === MORFING BLOB === */
.morph-blob {
    background: linear-gradient(245deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 400% 400%;
    animation: gradientShift 6s ease infinite, morph 12s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* === BIZTONSÁGI JELVÉNY === */
.security-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    position: relative;
    overflow: hidden;
}

.security-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* === GÉPELÉS ANIMÁCIÓ === */
.typing-animation::after {
    content: '|';
    color: #3b82f6;
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === HERO HÁTTÉR === */
.hero-bg {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1)),
                url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* === KÁRTYA HOVER === */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-12px) scale(1.02);
}

/* === ANIMÁCIÓK === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === SELECTION === */
::selection {
    background-color: rgba(59, 130, 246, 0.3);
    color: inherit;
}

::-moz-selection {
    background-color: rgba(59, 130, 246, 0.3);
    color: inherit;
}

/* === FOCUS STÍLUSOK === */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

/* === MOBIL OPTIMALIZÁLÁS === */
@media (max-width: 768px) {
    /* Szigorú viewport kontroll */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    /* Fix background mobil nézetben */
    .hero-bg {
        background-attachment: scroll;
        background-size: cover;
    }
    
    /* Szöveg méret növelése mobil olvashatósághoz */
    html {
        font-size: 14px;
    }
    
    /* MINDEN elem szigorú width limit */
    *,
    *::before,
    *::after {
        max-width: 100vw !important;
    }
    
    /* Képek biztonságos kezelése */
    img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block;
    }
    
    /* Szabó Tamás kép speciális kezelés */
    img[src*="szabotamas2.jpg"],
    img[src*="szabotamas2"],
    img[src*="/images/"] {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
    }
    
    /* Kép container-ek fix */
    .image-container,
    div:has(> img),
    figure,
    picture {
        overflow: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Grid és flex container fix */
    .grid,
    .flex,
    [class*="grid"],
    [class*="flex"] {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* Padding csökkentés mobil nézetben */
    .glass-effect,
    .glass-white {
        padding: 1rem;
        max-width: 100% !important;
    }
    
    /* Hover effekt kikapcsolása mobilon */
    .card-hover:hover {
        transform: none;
    }
    
    /* Neurális háttér optimalizálás */
    .neural-network {
        background-size: cover;
        background-position: center;
        max-width: 100vw !important;
    }
    
    /* Scrollbar rejtése mobilon */
    ::-webkit-scrollbar {
        width: 0;
        display: none;
    }
    
    /* User zoom tiltása mobilon */
    * {
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
    }
    
    input,
    textarea,
    select {
        user-select: text;
        -webkit-user-select: text;
    }
}

@media (max-width: 480px) {
    /* Extra szigorú kontroll kis képernyőkön */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    /* Extra kis képernyők */
    html {
        font-size: 13px;
    }
    
    /* MINDEN elem még szigorúbb limit */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Blob kisebb mobilon */
    .morph-blob {
        max-width: 100%;
    }
    
    /* Text glow redukálás */
    .text-glow {
        text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }
    
    /* Képek extra kicsi képernyőn */
    img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    /* Padding minimalizálás */
    .glass-effect,
    .glass-white {
        padding: 0.75rem !important;
    }
}

/* === TABLET NÉZET === */
@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    .hero-bg {
        background-attachment: scroll;
    }
}

/* === PRINT STÍLUSOK === */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    .glass-effect,
    .glass-white {
        background: white !important;
        border: 1px solid #ccc !important;
    }
}

/* === AKADÁLYMENTESÍTÉS === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === HIGH CONTRAST MÓD === */
@media (prefers-contrast: high) {
    .glass-effect {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #ffffff;
    }
    
    .text-glow {
        text-shadow: none;
    }
}

/* === DARK MODE TÁMOGATÁS === */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #1a1a2e;
    }
}