/* Plik: css/section-sync.css */

/* --- G?OWNA SEKCJA --- */
.sync-section {
    padding: 0;
    background-color: var(--bg-main);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 550px;
    overflow: hidden;
    
    /* Bez ramek */
    border: none;
    margin: 60px 0; 
}

/* --- LEWA KOLUMNA (Tekst) --- */
.sync-left-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    /* Matematyczne wyrownanie do lewej (1200px container) */
    padding-left: max(20px, calc((100vw - 1200px) / 2 + 20px)); 
    padding-right: 40px;
    
    padding-top: 60px;
    padding-bottom: 60px;
    
    background-color: var(--bg-main);
    position: relative;
    z-index: 5;
}

.sync-content {
    max-width: 550px;
    width: 100%;
}

/* TYPOGRAFIA */
.sync-content h2 {
    font-size: 3rem; 
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #fff;
    white-space: nowrap; 
}

.sync-content h2 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sync-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px; /* Zmniejszono z 40px dla lepszego upakowania */
    line-height: 1.6;
    max-width: 480px; 
}

/* LISTA ELEMENTOW - ZAGESZCZONA (OBSIDIAN STYLE) */
.sync-list { 
    display: flex; 
    flex-direction: column; 
    /* ZMIANA: Mniejszy odstep miedzy kafelkami (by?o 12px) */
    gap: 6px; 
}

.sync-item {
    display: flex; 
    align-items: flex-start; 
    gap: 16px; 
    
    /* ZMIANA: Mniejszy padding = nizsze kafelki (by?o 20px 24px) */
    padding: 12px 16px;
    
    border-radius: 12px; /* Troche mniejszy radius pasuje do nizszych kafli */
    border: 1px solid transparent; 
    cursor: pointer; 
    transition: all 0.2s ease;
    background: transparent;
}

.sync-icon {
    /* ZMIANA: Nieco mniejsza ikona dla proporcji */
    width: 24px; 
    height: 24px; 
    color: var(--text-muted);
    transition: color 0.3s; 
    margin-top: 2px; 
    flex-shrink: 0;
}

.sync-text h3 { 
    font-size: 1rem; 
    font-weight: 600; 
    /* ZMIANA: Mniejszy odstep pod tytu?em */
    margin-bottom: 2px; 
    color: #fff; 
}

.sync-text p { 
    /* ZMIANA: Nieco mniejszy tekst opisu dla kompakotwosci */
    font-size: 0.9rem; 
    color: var(--text-muted); 
    line-height: 1.4; 
    margin: 0; 
}

/* STAN AKTYWNY (GLOW) */
.sync-item.active {
    background: rgba(99, 102, 241, 0.08); 
    border: 1px solid rgba(99, 102, 241, 0.3);
    /* Subtelniejszy cien dla mniejszego elementu */
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.12); 
}

.sync-item.active .sync-icon { 
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5)); 
}

.sync-item:not(.active):hover {
    background: rgba(255, 255, 255, 0.03);
}


/* --- PRAWA KOLUMNA (OBRAZKI) --- */
.sync-image-wrapper.full-width-image {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px; 
    background: var(--bg-main); 
    
    border: none;
    
    overflow: hidden;
}

.sync-screenshot {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.sync-screenshot.active {
    opacity: 1; 
    visibility: visible; 
    z-index: 10;
}

.sync-screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- SLIDESHOW (KARUZELA - P?YNNY FADE) --- */
.slideshow-container { 
    width: 100%; 
    height: 100%; 
    position: relative; 
    background: var(--bg-main);
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    opacity: 0;
    z-index: 0;
    
    transition: opacity 1s ease-in-out;
    
    display: flex;
    align-items: center; 
    justify-content: flex-start; 
}

.slide.show {
    opacity: 1;
    z-index: 1;
}

.slide img {
    max-width: 100%;
    height: auto;
    width: 100%;
    display: block;
}

.slide-img {
    height: 100%;
    width: auto;
    min-width: 100%;
    
    object-fit: cover; 
    object-position: left center;
    
    display: block;
    max-width: 100%;
}

/* Fallback */
.placeholder-box {
    width: 100%; 
    height: 100%;
    background: var(--bg-secondary);
    border: none;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
}
.placeholder-box.fallback { display: none; }


/* --- RESPONSYWNOSC --- */
@media (max-width: 1240px) {
    .sync-left-wrapper {
        padding-left: 40px; 
    }

    .modal-window {
        transform: scale(0.42);
    }

    .glass-slideshow .slide {
        min-height: 100%;
    }
}

@media (max-width: 1100px) {
    .modal-window {
        transform: scale(0.38);
    }

    .glass-slideshow .slide {
        min-height: 100%;
    }
}

@media (max-width: 992px) {
    .sync-section {
        grid-template-columns: 1fr; 
        min-height: auto;
    }
    
    .sync-left-wrapper {
        padding: 60px 20px;
        align-items: center;
        text-align: center;
    }
    
    .sync-content {
        max-width: 100%;
    }

    .sync-content h2 {
        font-size: 2.5rem; 
        white-space: normal;
    }
    
    .sync-image-wrapper.full-width-image {
        min-height: 400px;
        height: 400px;
    }
    
    .slide-img {
        object-position: center top;
        width: 100%;
    }

    .modal-window {
        transform: scale(0.35);
    }

    .glass-slideshow .slide {
        min-height: 100%;
    }
}

@media (max-width: 768px) {
    .sync-image-wrapper.full-width-image {
        min-height: 350px;
        height: 350px;
    }

    .modal-window {
        transform: scale(0.28);
    }

    .static-app-bg img {
        transform: scale(1.1);
    }

    .glass-slideshow .slide {
        min-height: 100%;
    }

    .slide-img {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .sync-image-wrapper.full-width-image {
        min-height: 300px;
        height: 300px;
    }

    .modal-window {
        transform: scale(0.22);
    }

    .static-app-bg img {
        transform: scale(1.0);
    }

    .glass-slideshow .slide {
        min-height: 100%;
    }

    .slide-img {
        width: 100%;
        min-width: auto;
    }
}

/* ================= CINEMATIC FOCUS (LIGHT VERSION) ================= */

.smart-blur-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
}

.blur-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    
    background: radial-gradient(
        circle at center, 
        rgba(11, 12, 21, 0) 55%,      
        rgba(11, 12, 21, 0.15) 75%,   
        rgba(11, 12, 21, 0.85) 100%   
    );
}

/* Obrazek pod spodem */
.smart-blur-wrapper .slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    display: block;
    
    filter: brightness(1.0) contrast(1.0);
    
    transition: filter 0.3s ease;
}

.sync-screenshot:hover .slide-img {
    filter: brightness(1.0) contrast(1.0);
}

/* ================= SYSTEM WARSTWOWEJ KARUZELI (FINAL STABLE) ================= */

.glass-slideshow {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-main);
    border-radius: 12px;
}

/* T?O: Sta?y obrazek z Hero */
.static-app-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.static-app-bg img {
    width: 100%;
    height: 100%;
    /* KADR: Lewy gorny rog, lekki zoom */
    object-fit: cover;
    object-position: 0% 0%; 
    transform: scale(1.2);
}

.bg-overlay-blur {
    position: absolute;
    inset: 0;
    
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    
    background: rgba(11, 12, 21, 0.92);
}

/* KONTENER OKIEN */
.modal-layers {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* STYLIZACJA OKNA DIALOGOWEGO */
.modal-window {
    transform: scale(0.47);
    transform-origin: top center;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    
    display: block;
    
    box-shadow: none; 
    border: none;
    background: transparent;

    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- ANIMACJA I POZYCJONOWANIE --- */

.glass-slideshow .slide {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    padding-top: -60px;
    box-sizing: border-box; 
    
    opacity: 0;
    z-index: 0;
 
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.glass-slideshow .slide.show {
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
}

#img-search.sync-screenshot .glass-slideshow .slide {
    padding-top: 10px;
}

#img-profiles.sync-screenshot .glass-slideshow .slide {
    padding-top: 45px;
}