/* 
 * Interactive Logo Carousel CSS - MOBILE CLICK FIX VERSION
 * Prefiks: lcs- (Logo Carousel System)
 * VERSION: 2.6.0 - MOBILE CLICK OPTIMIZATION + SPEED ADJUSTMENT
 */

/* GŁÓWNY KONTENER */
.lcs-wrapper {
    position: relative;
    overflow: hidden;
    background: transparent;
    border: none;
    box-sizing: border-box;
    width: 100%;
    height: 120px;
    padding: 20px;
    margin: 20px auto;
    user-select: none;
}

/* KARUZELA */
.lcs-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: transparent;
    cursor: grab;
    /* MOBILE: Lepsze touch handling */
    touch-action: pan-x;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lcs-container.lcs-drag-enabled {
    cursor: grab;
}

.lcs-container.lcs-dragging {
    cursor: grabbing;
}

.lcs-container.lcs-drag-disabled {
    cursor: default;
}

/* MOBILE: Wyłącz cursor na touch devices */
@media (hover: none) and (pointer: coarse) {
    .lcs-container,
    .lcs-container.lcs-drag-enabled,
    .lcs-container.lcs-dragging {
        cursor: default !important;
    }
}

/* CAŁKOWITE WYŁĄCZENIE NATIVE DRAG */
.lcs-container,
.lcs-container *,
.lcs-container img,
.lcs-container a {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    pointer-events: auto;
    /* MOBILE: Dodatkowe zabezpieczenia */
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* DODATKOWE ZABEZPIECZENIE DLA OBRAZKÓW */
.lcs-container img {
    draggable: false !important;
    /* MOBILE: Zapobiegaj długiemu dotknięciu */
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    pointer-events: none; /* Nie interferuj z custom touch handling */
}

/* ŚCIEŻKA PRZEWIJANIA */
.lcs-track {
    display: flex;
    align-items: center;
    height: 100%;
    transition: transform 0.3s ease-out;
    will-change: transform;
    /* MOBILE: GPU acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* AUTOMATYCZNE PRZEWIJANIE */
.lcs-track.lcs-auto-scrolling {
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* POJEDYNCZE LOGO */
.lcs-container .lcs-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 150px;
    min-width: 150px;
    margin-right: 40px;
    pointer-events: auto;
    /* MOBILE: Lepsze touch target */
    position: relative;
}

.lcs-container .lcs-item:last-child {
    margin-right: 40px;
}

/* OBRAZY */
.lcs-container .lcs-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: grayscale(30%) opacity(0.85);
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    /* MOBILE: Wyłącz długie dotknięcie */
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
}

/* EFEKT HOVER - tylko na desktop */
@media (hover: hover) and (pointer: fine) {
    .lcs-container:not(.lcs-dragging) .lcs-item:hover img {
        transform: scale(1.08);
        filter: grayscale(0%) opacity(1);
    }
}

/* LINKI - MOBILE OPTIMIZED */
.lcs-container .lcs-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    pointer-events: auto;
    /* MOBILE: Większy touch target */
    position: relative;
    /* MOBILE: Wyłącz highlight */
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    outline: none;
}

/* MOBILE: Lepszy feedback dla touch */
@media (hover: none) and (pointer: coarse) {
    .lcs-container .lcs-item a {
        /* MOBILE: Minimalny padding dla większego touch target */
        padding: 5px;
        margin: -5px;
        border-radius: 8px;
    }
    
    .lcs-container .lcs-item a:active {
        background: rgba(0,0,0,0.05);
        transform: scale(0.98);
    }
}

/* DESKTOP: Subtelny hover effect */
@media (hover: hover) and (pointer: fine) {
    .lcs-container:not(.lcs-dragging) .lcs-item a:hover {
        background: rgba(255,255,255,0.1);
        border-radius: 4px;
    }
}

/* Wyłącz linki podczas przeciągania */
.lcs-container.lcs-dragging .lcs-item a {
    pointer-events: none !important;
}

/* ANIMACJE PRZEWIJANIA */
@keyframes lcs-scroll-left-auto {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.333%);
    }
}

@keyframes lcs-scroll-right-auto {
    0% {
        transform: translateX(-33.333%);
    }
    100% {
        transform: translateX(0);
    }
}

/* STAN PAUZOWANIA */
.lcs-container.lcs-paused .lcs-track {
    animation-play-state: paused;
}

/* MOMENTUM SCROLLING */
.lcs-track.lcs-momentum {
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* MOBILE: Krótsza animacja momentum */
@media (hover: none) and (pointer: coarse) {
    .lcs-track.lcs-momentum {
        transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}

/* STANY PRZECIĄGANIA */
.lcs-container.lcs-dragging {
    cursor: grabbing !important;
}

.lcs-container.lcs-dragging .lcs-track {
    transition: none !important;
    animation: none !important;
}

.lcs-container.lcs-dragging .lcs-item a {
    pointer-events: none !important;
}

/* RESPONSIVE DESIGN - MOBILE OPTIMIZED */
@media (max-width: 1024px) {
    .lcs-wrapper {
        padding: 15px !important;
        height: 100px !important;
    }
    
    .lcs-container .lcs-item {
        width: 120px !important;
        min-width: 120px !important;
        margin-right: 30px !important;
    }
}

/* MOBILE: Zwiększone touch targets i zmniejszona prędkość */
@media (max-width: 768px) {
    .lcs-wrapper {
        padding: 10px !important;
        height: 80px !important;
    }
    
    .lcs-container .lcs-item {
        width: 100px !important;
        min-width: 100px !important;
        margin-right: 20px !important;
    }
    
    .lcs-container .lcs-item img {
        filter: grayscale(20%) opacity(0.9);
    }
    
    /* MOBILE: Większy touch target dla linków */
    .lcs-container .lcs-item a {
        padding: 8px;
        margin: -8px;
        min-height: 44px; /* Apple guideline dla touch targets */
        min-width: 44px;
    }
    
    /* MOBILE: Wyłącz wszystkie hover effects */
    .lcs-container .lcs-item:hover img {
        transform: none !important;
        filter: grayscale(20%) opacity(0.9) !important;
    }
    
    .lcs-container .lcs-item a:hover {
        background: none !important;
    }
}

@media (max-width: 480px) {
    .lcs-wrapper {
        padding: 8px !important;
        height: 70px !important;
    }
    
    .lcs-container .lcs-item {
        width: 80px !important;
        min-width: 80px !important;
        margin-right: 15px !important;
    }
    
    /* MOBILE: Jeszcze większe touch targets na małych ekranach */
    .lcs-container .lcs-item a {
        padding: 10px;
        margin: -10px;
        min-height: 48px;
        min-width: 48px;
    }
}

/* TOUCH DEVICES - ULEPSZONE */
@media (hover: none) and (pointer: coarse) {
    .lcs-container {
        cursor: default;
        touch-action: pan-x;
        /* MOBILE: Wyłącz domyślne touch behaviors */
        -webkit-overflow-scrolling: touch;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* MOBILE: Szybsze transitions */
    .lcs-track {
        transition: transform 0.2s ease-out;
    }
    
    .lcs-track.lcs-momentum {
        transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    /* MOBILE: Wyłącz wszystkie hover effects */
    .lcs-container .lcs-item:hover img {
        transform: none !important;
        filter: grayscale(20%) opacity(0.9) !important;
    }
    
    .lcs-container .lcs-item a:hover {
        background: none !important;
    }
    
    /* MOBILE: Active state feedback */
    .lcs-container .lcs-item a:active {
        background: rgba(0,0,0,0.05) !important;
        transform: scale(0.98) !important;
        transition: all 0.1s ease-out !important;
    }
}

/* PRELOADER */
.lcs-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: lcs-spin 1s linear infinite;
    z-index: 10;
}

.lcs-wrapper.lcs-loaded::before {
    display: none;
}

@keyframes lcs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* WSKAŹNIKI KIERUNKU PRZECIĄGANIA */
.lcs-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(0,115,170,0.1) 0%, 
        transparent 20%, 
        transparent 80%, 
        rgba(0,115,170,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.lcs-container.lcs-dragging::after {
    opacity: 1;
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
    .lcs-container .lcs-track {
        animation-duration: 120s !important;
    }
    
    .lcs-container .lcs-item img {
        transition: none;
    }
    
    .lcs-container .lcs-item:hover img {
        transform: none;
    }
    
    .lcs-track.lcs-momentum {
        transition: none;
    }
}

/* WYSOKOŚĆ KONTRASTU */
@media (prefers-contrast: high) {
    .lcs-container .lcs-item img {
        filter: none;
        border: 1px solid #333;
    }
    
    .lcs-container:not(.lcs-dragging) .lcs-item:hover img {
        border-color: #0073aa;
        box-shadow: 0 0 10px rgba(0,115,170,0.5);
    }
}

/* TRYB CIEMNY */
@media (prefers-color-scheme: dark) {
    .lcs-container .lcs-item img {
        filter: grayscale(20%) opacity(0.9) brightness(1.1);
    }
    
    .lcs-container:not(.lcs-dragging) .lcs-item:hover img {
        filter: grayscale(0%) opacity(1) brightness(1.2);
    }
    
    .lcs-container:not(.lcs-dragging) .lcs-item a:hover {
        background: rgba(255,255,255,0.05);
    }
}

/* FOKUS KEYBOARD NAVIGATION */
.lcs-container .lcs-item a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 4px;
}

.lcs-container.lcs-dragging .lcs-item a:focus {
    outline: none;
}

/* MOBILE: Focus visible tylko przy keyboard navigation */
@media (hover: none) and (pointer: coarse) {
    .lcs-container .lcs-item a:focus {
        outline: none;
    }
    
    .lcs-container .lcs-item a:focus-visible {
        outline: 2px solid #0073aa;
        outline-offset: 2px;
    }
}

/* HIGH DPI DISPLAYS */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .lcs-container .lcs-item img {
        image-rendering: crisp-edges;
        image-rendering: -webkit-optimize-contrast;
    }
}

/* NAPRAWIONE BŁĘDY DRAG & DROP */
.lcs-container.lcs-dragging * {
    pointer-events: none !important;
}

.lcs-container.lcs-dragging .lcs-item {
    pointer-events: none !important;
}

.lcs-container.lcs-dragging .lcs-track,
.lcs-container.lcs-dragging .lcs-track * {
    animation: none !important;
    transition: none !important;
    animation-play-state: paused !important;
}

/* DEBUG MODE */
.lcs-wrapper.lcs-debug {
    border: 2px solid red !important;
}

.lcs-wrapper.lcs-debug .lcs-container {
    border: 2px solid blue !important;
}

.lcs-wrapper.lcs-debug .lcs-track {
    border: 2px solid green !important;
}

.lcs-wrapper.lcs-debug .lcs-item {
    border: 1px solid orange !important;
}

/* MOBILE DEBUG INFO */
.lcs-wrapper.lcs-debug.lcs-mobile::before {
    content: 'MOBILE MODE' !important;
    position: absolute !important;
    top: 5px !important;
    left: 5px !important;
    background: red !important;
    color: white !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
    z-index: 1000 !important;
    border-radius: 3px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border: none !important;
    animation: none !important;
}

/* MOBILE: Feedback podczas przeciągania */
@media (hover: none) and (pointer: coarse) {
    .lcs-container.lcs-dragging {
        cursor: default;
        background: rgba(0,0,0,0.02);
        border-radius: 8px;
    }
}

/* FALLBACK dla starszych przeglądarek */
@supports not (animation-play-state: paused) {
    .lcs-container .lcs-track {
        animation: none;
    }
    
    .lcs-container .lcs-item {
        animation: lcs-float 3s ease-in-out infinite;
    }
}

@keyframes lcs-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* MOBILE: Dodatkowe optimalizacje GPU */
@media (hover: none) and (pointer: coarse) {
    .lcs-container,
    .lcs-track,
    .lcs-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000;
        perspective: 1000;
    }
}