/* ==========================================
   BAZA STRONY
   ========================================== */
body {
    background-color: #050505;
    color: white;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding-top: 100px;
    overflow-x: hidden;
}

/* ==========================================
   NOWY UKŁAD STRONY
   ========================================== */
.tutorials-page-wrapper {
    display: flex;
    width: 100%;
}

/* 1. SKRAJNIE LEWE MENU (KATEGORIE PORADNIKÓW) */
.master-sidebar {
    position: fixed;
    top: 100px; 
    left: 0;
    width: 260px;
    height: calc(100vh - 100px);
    background-color: #0a0a0a;
    border-right: 1px solid #2C2C2C;
    /* Zwiększony padding górny (było 2rem), żeby navbar nie ucinał tytułu! */
    padding: 3.5rem 1rem 2rem 1rem; 
    z-index: 9980;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

.master-sidebar__title {
    color: #4a4a4a;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 10px;
}

.master-link {
    background: transparent;
    border: none;
    color: #cccccc;
    text-align: left;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: 'Poppins', sans-serif;
}

.master-link i {
    font-size: 1.2rem;
    color: #808080;
    transition: all 0.3s ease;
}

.master-link:hover {
    background: #1a1a1a;
    color: white;
}

.master-link.active {
    background: rgba(230, 0, 0, 0.1);
    color: #E60000;
    border-left: 4px solid #E60000;
}

.master-link.active i {
    color: #E60000;
}

/* ==========================================
   BADGE "MEGA" (Złoty wyróżnik Premium)
   ========================================== */
.mega-badge {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(90deg, #D4AF37 0%, #FFF5A5 50%, #D4AF37 100%);
    background-size: 200% auto;
    color: #050505;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px; 
    margin-left: auto;
    flex-shrink: 0; 
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4); 
    border: none;
    animation: shine-gold 3s linear infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@keyframes shine-gold {
    to { background-position: 200% center; }
}

/* ==========================================
   2. GŁÓWNY KONTENER NA TREŚĆ 
   ========================================== */
.tutorials-content-area {
    margin-left: 260px; 
    width: calc(100% - 260px);
}

.tutorial-wrapper {
    display: none; 
    max-width: 1500px; 
    margin: 0 auto;
    padding: 3rem 4rem 6rem 10px; 
    animation: fadeIn 0.4s ease forwards;
}

.tutorial-wrapper.active {
    display: flex; 
    align-items: flex-start;
    gap: 40px; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   3. WEWNĘTRZNY SIDEBAR (KOTWICE KROKÓW) 
   ========================================== */
.tutorial-sidebar {
    position: sticky; 
    top: 50vh;
    transform: translateY(-50%);
    left: 270px; 
    width: 65px;
    flex-shrink: 0; 
    z-index: 90;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none; 
}

/* TWEAK DLA DŁUGIEJ PIGUŁKI (14 KROKÓW) - Daje ją nieco niżej! */
.tutorial-sidebar.long-sidebar {
    top: 55vh; 
    transform: translateY(-40%);
}
.tutorial-sidebar.long-sidebar .sidebar-nav {
    gap: 8px; /* Mniejsze odstępy, żeby się zmieściło */
    padding: 15px 8px;
}
.tutorial-sidebar.long-sidebar .sidebar-link {
    width: 40px;
    height: 40px;
    font-size: 1.1rem; /* Mniejsze ikonki */
}

.tutorial-sidebar::-webkit-scrollbar { display: none; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background-color: #0d0d0d;
    padding: 20px 10px;
    border-radius: 40px; 
    border: 1px solid #1a1a1a;
    box-shadow: 0 15px 35px rgba(0,0,0,0.9);
}

.sidebar-link {
    width: 45px;
    height: 45px;
    border-radius: 14px; 
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555555; 
    text-decoration: none;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0; 
}

.sidebar-link:hover { color: #ffffff; }

.sidebar-link.active {
    background-color: #E60000;
    color: white;
    box-shadow: 0 0 15px rgba(230, 0, 0, 0.6); 
}

.tooltip-text {
    position: absolute;
    left: 65px;
    background-color: #1E1E1E;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #2C2C2C;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.sidebar-link:hover .tooltip-text {
    opacity: 1; visibility: visible; transform: translateX(0);
}

.tutorial-content { flex-grow: 1; min-width: 0; }

/* ==========================================
   WYGLĄD TREŚCI PORADNIKA & CZERWONA POŚWIATA
   ========================================== */
.tutorial-header { text-align: center; margin-bottom: 5rem; }
.tutorial-header h1 { font-size: 4rem; font-weight: 900; margin: 0 0 1rem 0; text-transform: uppercase; }
.tutorial-header p { color: #808080; font-size: 1.2rem; max-width: 800px; margin: 0 auto; }
.text-red { color: #E60000; }

.tutorial-section {
    display: flex; 
    align-items: center; 
    gap: 3.5rem; 
    margin-bottom: 6rem;
    padding: 3rem; 
    background-color: #121212; 
    border: 1px solid #2C2C2C;
    border-radius: 30px; 
    /* Delikatna czerwona poświata w tle sekcji */
    box-shadow: 0 25px 50px rgba(0,0,0,0.6), 0 0 45px rgba(230, 0, 0, 0.05);
    overflow: hidden; 
    scroll-margin-top: 20vh; 
    transition: box-shadow 0.4s ease; 
}

/* Wzmocnienie poświaty po najechaniu myszką */
.tutorial-section:hover {
    box-shadow: 0 30px 60px rgba(0,0,0,0.7), 0 0 70px rgba(230, 0, 0, 0.12);
}

.tutorial-section.reverse { flex-direction: row-reverse; }

.tutorial-text { 
    flex: 1.1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.step-badge {
    display: inline-block; background-color: rgba(230, 0, 0, 0.1); color: #E60000;
    padding: 6px 18px; border-radius: 20px; font-weight: 800; font-size: 1rem;
    letter-spacing: 2px; margin-bottom: 1.5rem; width: max-content; border: 1px solid rgba(230, 0, 0, 0.3);
}

.tutorial-text h2 { font-size: 2.5rem; margin: 0 0 1.5rem 0; color: white; }

/* ==========================================
   LISTA KROKÓW Z FA-CHECK
   ========================================== */
.styled-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

.styled-list li { 
    color: #cccccc; 
    font-size: 1.15rem; 
    line-height: 1.6; 
    display: block; 
    position: relative;
    padding-left: 48px; 
}

.styled-list li i.fa-check {
    position: absolute;
    left: 0;
    top: 3px;
    color: #E60000; 
    background-color: rgba(230, 0, 0, 0.1); 
    border: 1px solid rgba(230, 0, 0, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%; 
    font-size: 0.9rem; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================
   AFILIACYJNE RAMKI (AFF-BOX)
   ========================================== */
.aff-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #2C2C2C;
    margin-top: 10px;
    width: fit-content;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.aff-box.inline {
    display: inline-flex;
    margin-top: 0;
    vertical-align: middle; 
    padding: 4px 12px;
}

.aff-link {
    color: #cccccc;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.aff-link i {
    color: #E60000;
    margin-right: 5px;
}

.aff-link:hover {
    color: #ffffff;
}

.aff-code {
    color: #E60000;
    font-weight: 800;
    letter-spacing: 1px;
}

.aff-copy {
    background: none;
    border: none;
    color: #808080;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.aff-copy:hover {
    color: #E60000;
    background-color: rgba(230, 0, 0, 0.1);
    transform: scale(1.1);
}

/* ==========================================
   BUTTONY PRZEJDŹ DO KARTY
   ========================================== */
.step-link-box {
    margin-top: 30px;
    align-self: flex-start; 
}

.step-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(230, 0, 0, 0.05); 
    color: #E60000;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid rgba(230, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.step-link-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.step-link-btn:hover {
    background-color: #E60000;
    color: white;
    box-shadow: 0 5px 20px rgba(230, 0, 0, 0.4);
    border-color: #E60000;
}

.step-link-btn:hover i {
    transform: translate(3px, -3px); 
}

/* ==========================================
   TUTORIAL SLIDER & ZOOM
   ========================================== */
.tutorial-slider {
    flex: 1; 
    position: relative; 
    border-radius: 20px; 
    overflow: hidden;
    aspect-ratio: 16 / 10; 
    border: 1px solid #2C2C2C; 
    background-color: #000; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.slide { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0; 
    transition: opacity 0.5s ease-in-out, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    pointer-events: none; 
}

.slide.active { 
    opacity: 1; 
    pointer-events: auto; 
    cursor: zoom-in;
}

/* Nakładka Lupy & Zoom */
.tutorial-slider:hover .slide.active {
    transform: scale(1.08);
}

.tutorial-slider::after {
    content: '\f00e'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0); 
    color: rgba(255, 255, 255, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    pointer-events: none; 
    transition: all 0.4s ease;
    z-index: 4; 
}

.tutorial-slider:hover::after {
    background: rgba(5, 5, 5, 0.178); 
    backdrop-filter: blur(0.01px); 
    color: rgba(255, 255, 255, 0.9); 
}

.slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(5, 5, 5, 0.7);
    color: white; border: 1px solid rgba(255,255,255,0.1); width: 50px; height: 50px;
    border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.3s; z-index: 5; font-size: 1.2rem;
}

.slider-btn:hover { background: #E60000; border-color: #E60000; }
.prev-btn { left: 15px; } .next-btn { right: 15px; }

.slider-dots {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex;
    gap: 10px; z-index: 5; background: rgba(0,0,0,0.5); padding: 8px 15px; border-radius: 20px;
}

.dot { width: 12px; height: 12px; background-color: rgba(255,255,255,0.4); border-radius: 50%; cursor: pointer; transition: all 0.3s; }
.dot.active { background-color: #E60000; transform: scale(1.3); }

/* ==========================================
   ANIMACJE WJAZDU NA SCROLL
   ========================================== */
.tutorial-section .tutorial-slider,
.tutorial-section .tutorial-text {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tutorial-section:not(.reverse) .tutorial-slider { transform: translateX(-150px); }
.tutorial-section:not(.reverse) .tutorial-text { transform: translateX(150px); }

.tutorial-section.reverse .tutorial-text { transform: translateX(-150px); }
.tutorial-section.reverse .tutorial-slider { transform: translateX(150px); }

.tutorial-section.animate-in .tutorial-slider,
.tutorial-section.animate-in .tutorial-text {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================
   MODAL DO ZDJĘĆ (Lightbox)
   ========================================== */
.custom-image-modal {
    display: none; 
    position: fixed;
    z-index: 999999; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 5, 0.85); 
    backdrop-filter: blur(8px); 
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-image-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.custom-image-modal .modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(230, 0, 0, 0.2); 
    border: 2px solid #2C2C2C;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-image-modal.show .modal-content {
    transform: scale(1); 
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #cccccc;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000000;
}

.close-modal:hover {
    color: #E60000;
    transform: scale(1.1) rotate(90deg); 
}
/* Kontener dla przycisku wideo */
/* BOCZNY PRZYCISK - Zawsze widoczny */
/* --- WERSJA DESKTOP (PC) --- */
.sticky-yt-btn {
    position: fixed;
    right: 0; /* Przyklejony całkowicie do prawej krawędzi */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(8px); /* Efekt rozmycia tła pod przyciskiem */
    border: 1px solid #2a2a2a;
    border-right: none;
    border-radius: 16px 0 0 16px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
}

.sticky-yt-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #E60000, #990000);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(230, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.sticky-yt-text {
    /* Litery ustawione pionowo, jedna pod drugą */
    writing-mode: vertical-rl;
    text-orientation: upright; 
    color: #888888;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -3px; /* Zmniejszamy odstęp między literami w pionie */
    transition: color 0.3s ease;
}

/* Efekty po najechaniu myszką */
.sticky-yt-btn:hover {
    background: #111111;
    border-color: #E60000;
    padding-right: 15px; /* Lekko wysuwa się w lewo */
    box-shadow: -8px 0 30px rgba(230, 0, 0, 0.15);
}

.sticky-yt-btn:hover .sticky-yt-icon {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(230, 0, 0, 0.7);
}

.sticky-yt-btn:hover .sticky-yt-text {
    color: #ffffff;
}

/* --- WERSJA MOBILNA (Telefony) --- */
@media (max-width: 768px) {
    .sticky-yt-btn {
        top: auto;
        bottom: 25px; /* Odstęp od dołu */
        right: 20px;  /* Odstęp od prawej */
        transform: none;
        border: 1px solid #2a2a2a;
        border-radius: 50%; /* Zmieniamy w idealne koło */
        padding: 10px;
        background: rgba(13, 13, 13, 0.95);
        box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    }

    .sticky-yt-text {
        display: none; /* Na telefonie ukrywamy tekst, zostawiamy samą ikonę */
    }

    .sticky-yt-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        border-radius: 50%; /* Okrągła ikona */
        animation: pulse-red 2s infinite; /* Dodajemy animację zwracającą uwagę */
    }

    /* Animacja pulsowania dla mobilki */
    @keyframes pulse-red {
        0% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0.5); }
        70% { box-shadow: 0 0 0 12px rgba(230, 0, 0, 0); }
        100% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0); }
    }
}

/* ==========================================
   RESPONSYWNOŚĆ (MOBILE)
   ========================================== */
@media (max-width: 1200px) {
    .tutorials-page-wrapper { flex-direction: column; }
    
    .master-sidebar {
        position: sticky; top: 100px; left: 0; width: 100%; height: auto;
        flex-direction: row; border-right: none; border-bottom: 1px solid #2C2C2C;
        padding: 10px; overflow-x: auto; box-shadow: 0 10px 20px rgba(0,0,0,0.3); align-items: center;
        z-index: 9980;
    }
    
    .master-sidebar__title { display: none; }
    .master-link { white-space: nowrap; padding: 10px 15px; }
    .tutorials-content-area { margin-left: 0; width: 100%; }
    .tutorial-wrapper.active { flex-direction: column; gap: 20px; }
    
    .tutorial-sidebar {
        width: 100%; position: fixed; bottom: 20px; top: auto; left: 0;
        transform: none; z-index: 9999; display: flex; justify-content: center; max-height: none;
    }
    
    .sidebar-nav { flex-direction: row; border-radius: 40px; padding: 10px 20px; gap: 10px; }
    .tutorial-sidebar.long-sidebar .sidebar-nav { padding: 10px; gap: 5px; } 
    .tooltip-text { display: none; }
    
    .tutorial-wrapper { padding: 2rem 1rem 6rem 1rem; }
    .tutorial-section, .tutorial-section.reverse { flex-direction: column; gap: 3rem; padding: 2rem; }
    .tutorial-section .tutorial-slider, .tutorial-section .tutorial-text { opacity: 1; transform: none !important; }
    .tutorial-slider { width: 100%; }
}
/* ==========================================
   SEKCJA INFORMACYJNA (ZASADY I LIMITY)
   ========================================== */
.tutorial-section.full-width-info {
    display: block;
    padding: 3rem 4rem;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.rule-card {
    background: rgba(18, 18, 18, 0.5);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.rule-card:hover {
    border-color: var(--primary);
    background: rgba(230, 0, 0, 0.05);
    transform: translateY(-5px);
}

.rule-card h3 {
    color: white;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-card h3 i {
    color: var(--primary);
    font-size: 1.2rem;
}

.rule-card p, .rule-card ul {
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.rule-card ul {
    padding-left: 20px;
    margin-top: 10px;
}

.rule-card ul li {
    margin-bottom: 5px;
}

.rule-card ul li::marker {
    color: var(--primary);
}

/* ==========================================
   MOBILE (RESPONSYWNOŚĆ TUTORIALA)
   ========================================== */

@media (max-width: 768px) {

    .tutorial-content {
        padding: 0 5vw;
    }

    .tutorial-header h1 {
        font-size: 6vw;
        line-height: 1.2;
    }

    .tutorial-header p {
        font-size: 3.5vw;
    }

    /* GŁÓWNA SEKCJA */
    .tutorial-section {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 40px;
    }

    /* RESET reverse */
    .tutorial-section.reverse {
        flex-direction: column;
    }

    /* SLIDER / OBRAZ */
    .tutorial-slider {
        width: 100%;
        height: auto;
        border-radius: 12px;
        overflow: hidden;
    }

    .tutorial-slider img,
    .tutorial-slider video {
        width: 100%;
        height: auto;
        object-fit: cover;
        display: block;
    }

    /* TEKST */
    .tutorial-text {
        width: 100%;
    }

    .tutorial-text h2 {
        font-size: 5vw;
        line-height: 1.3;
    }

    .tutorial-text p,
    .tutorial-text li {
        font-size: 3.6vw;
        line-height: 1.6;
    }

    .step-badge {
        font-size: 3vw;
        padding: 6px 12px;
    }

    /* LISTA */
    .styled-list {
        padding-left: 0;
    }

    .styled-list li {
        display: flex;
        align-items: flex-start;
        gap: 8px;
    }

    /* BUTTONY */
    .step-link-box {
        margin-top: 15px;
    }

    .step-link-btn {
        width: 100%;
        justify-content: center;
        font-size: 3.5vw;
        padding: 12px;
    }

    /* SLIDER BUTTONY */
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* RULES GRID */
    .rules-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rule-card h3 {
        font-size: 4.5vw;
    }

    .rule-card p,
    .rule-card li {
        font-size: 3.5vw;
    }

    /* SIDEBAR (opcjonalnie ukrycie na mobile) */
    .tutorial-sidebar {
        display: none;
    }
}