/* ==========================================================================
   1. KONTENER SLIDERA (SIATKA MESH)
   ========================================================================== */

.slider-container {
    position: relative;
    width: 100vw;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1920 / 800;
    overflow: hidden;
    display: block;
    background-color: #000; /* Czarny podkład, aby nie było białych dziur */
}

.source-slides {
    display: none;
}

.grid-container {
    display: grid;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2; 
    justify-items: stretch; /* Wymusza wypełnienie kolumny przez kafelek */
    align-items: stretch;   /* Wymusza wypełnienie wiersza przez kafelek */
}

.grid-tile {
    position: relative;
    overflow: hidden;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer;
    display: block;
}

.tile-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    background-repeat: no-repeat !important;
}

.tile-bg-under {
    z-index: 1;
}

.tile-bg-front {
    z-index: 2;
    opacity: 0;
}

/* PODŚWIETLANIE KWADRATÓW PO NAJECHANIU MYSZĄ */
.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 3;
    pointer-events: none;
    background-color: rgba(128, 128, 128, 0.15);
}

.grid-tile:hover .tile-overlay {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

.tile-overlay.active {
    background-color: rgba(128, 128, 128, 0.4);
}

/* ==========================================================================
   2. LINIE PODZIAŁU I KROPKI NA ŁĄCZENIACH (MAPPING)
   ========================================================================== */

.lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.grid-line {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.15);
    transition: background-color 0.3s ease;
}

.grid-line.vertical {
    top: 0;
    bottom: 0;
    width: 1px;
}

.grid-line.horizontal {
    left: 0;
    right: 0;
    height: 1px;
}

.mesh-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 4;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
    opacity: 0;
}

.mesh-dot.active {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
}

/* ==========================================================================
   3. WARSTWA Z TREŚCIĄ (SLIDES CONTENT)
   ========================================================================== */

.slider-content-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; 
    pointer-events: none; 
}

.slider-content-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 10%;
    padding-right: 40%;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; 
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.slider-content-item.active {
    opacity: 1;
    visibility: visible;
}

.slider-content-item h1 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: #ffffff;
    font-size: 3.5rem;
    margin: 0 0 20px 0;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
    transition-delay: 0.2s;
    pointer-events: auto; 
}

.slider-content-item p {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    line-height: 1.6;
    margin: 0 0 35px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
    transition-delay: 0.3s;
    pointer-events: auto;
}

.slider-content-item.active h1,
.slider-content-item.active p {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   4. PRZYCISK (CYBER GLASS)
   ========================================================================== */

.cyber-glass-btn {
    position: relative;
    z-index: 10;
    pointer-events: auto; 
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    color: #ffffff;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 14px 32px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
}

.slider-content-item.active .cyber-glass-btn {
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease, background 0.3s, border 0.3s, box-shadow 0.3s;
    transition-delay: 0.4s;
}

.cyber-glass-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.cyber-glass-btn:hover::before {
    left: 100%;
}

.cyber-glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   5. KROPKI NAWIGACYJNE SLIDERA (DOTS NAV)
   ========================================================================== */

.dots-container {
    position: absolute;
    bottom: 40px;
    right: 60px;
    display: flex;
    gap: 15px;
    z-index: 6; 
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-dot.active {
    background-color: #ffffff;
    transform: scale(1.2);
}

/* ==========================================================================
   6. RESPONSYWNOŚĆ DLA SLIDERA (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 1200px) {
    .slider-content-item {
        padding-right: 20%; 
    }
    .slider-content-item h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 992px) {
    .slider-container {
        aspect-ratio: 4 / 3; 
    }
    .slider-content-item h1 {
        font-size: 2.2rem;
    }
    .slider-content-item p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .slider-container {
        aspect-ratio: 1080 / 1350 !important; 
        width: 100vw !important;
        height: auto !important;
    }
    
    .slider-content-layer {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 40%, transparent 100%);
    }

    .slider-content-item {
        padding: 80px 30px 0 30px !important; 
        justify-content: flex-start; 
        align-items: center; 
        text-align: center;  
    }
    
    .slider-content-item h1 {
        font-size: 1.8rem; 
        line-height: 1.3;
    }
    
    .slider-content-item p {
        font-size: 0.95rem;
    }

    .dots-container {
        bottom: 30px;
        right: 50%;
        transform: translateX(50%); 
    }
}