/* ========================================================
   USTAWIENIA GLOBALNE I BAZOWE
   ======================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0d1117;
    color: #fff;
    overflow-x: hidden;
}

/* ========================================================
   WARSTWA PARALAKSY (VIEWPORT & BACKGROUND)
   ======================================================== */
/* Kontener blokujący fałszywe paski przewijania i dopasowany do okna */
.parallax-viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden; /* Odcina nadmiar tła i blokuje powstawanie scrollbarów */
    pointer-events: none;
}

/* Dynamiczne tło z zapasem przemieszczające się wewnątrz kontenera */
.parallax-bg {
    position: absolute;
    /* Fizyczny bufor z każdej strony na ruch myszą bez odsłaniania czarnego tła */
    top: -15vh;
    left: -15vw;
    width: 130vw;
    height: 130vh;
    background-image: url('img/z20.png'); 
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    will-change: transform; 
    
    /* 
       Ponieważ tło jest w oknie fixed, ujemny scroll stawia naturalny opór,
       a wartości myszy przesuwają tło odwrotnie do kursora.
    */
    transform: translateY(calc(var(--scroll-y, 0px) * -0.18)) 
               translate(calc(var(--mouse-x, 0px) * -1), calc(var(--mouse-y, 0px) * -1));
}

/* ========================================================
   PASEK NAWIGACJI (TOP-NAVBAR)
   ======================================================== */
#top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 1000;
}
.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: #58a6ff;
}

/* ========================================================
   MENU HAMBURGER (PRZYCISK)
   ======================================================== */
#menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}
#menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #c9d1d9;
    border-radius: 3px;
    transition: all 0.3s ease;
}
#menu-toggle.open span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
#menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
#menu-toggle.open span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ========================================================
   LINKI MENU I DROPDOWN (DESKTOP)
   ======================================================== */
.nav-links {
    display: flex;
    list-style: none;
    gap: 10px;
    height: 100%;
}
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}
.nav-item > a {
    color: #c9d1d9;
    text-decoration: none;
    font-weight: 500;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.3s;
    cursor: pointer;
}
.nav-item:hover > a {
    color: #58a6ff;
}
.navbar-dropdown {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #161b22;
    border: 1px solid #30363d;
    border-top: none;
    border-radius: 0 0 6px 6px;
    list-style: none;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-item:hover .navbar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.navbar-dropdown li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: #c9d1d9;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.navbar-dropdown li a:hover {
    background: #1f6feb;
    color: #fff;
}

/* ========================================================
   KONTENER MAPY I ELEMENTY PLANSZY (PRZYCISKI/ORBITY)
   ======================================================== */
#space-container {
    margin-top: 60px;
    position: relative;
    width: 100vw;
    background: transparent; 
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 220px; /* Zwiększony odstęp na telefonie, by kręgi podmenu miały miejsce */
	height: calc(100vh - 60px);
}
.node-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
}
.main-button {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #1f6feb 0%, #114494 100%);
    border: 3px solid #58a6ff;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.6);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 10;
    text-decoration: none; 
    text-align: center;      /* Środkuje tekst w poziomie po przełamaniu */
    white-space: normal;     /* Pozwala na łamanie tekstu do nowej linii */
    word-wrap: break-word;   /* Bezpieczne łamanie długich słów */
    padding: 10px;           /* Zabezpiecza, by tekst nie dotykał krawędzi koła */
}
.node-container:hover .main-button {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(88, 166, 255, 0.9);
}

/* Orbita podmenu – wspólny wygląd i animacja */
.submenu-orbit {
    position: absolute;
    width: 260px;
    height: 260px;
    border: 1px dashed rgb(219 231 245 / 38%);
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Na komputerach i tabletach (od 768px w górę) otwieramy klasycznie przez HOVER */
@media (min-width: 768px) {
    .node-container:hover .submenu-orbit {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }
}

/* Włączenie pokazywania przez scroll-klasę .active (głównie dla telefonów) */
.submenu-orbit.active {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
}

/* Owalne przyciski opcji – zawsze pozycjonowane absolutnie (okrąg) */
.submenu-item {
    position: absolute !important; 
    background: rgba(22, 27, 34, 0.95);
    border: 2px solid #30363d;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #c9d1d9;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
    transform: translate(-50%, -50%); 
}
.submenu-item:hover {
    background: #238636;
    border-color: #2ea44f;
    color: white;
    box-shadow: 0 0 10px rgba(46, 164, 79, 0.5);
}

/* ========================================================
   RESPONSYWNOŚĆ (MEDIA QUERIES)
   ======================================================== */

/* --- 1. URZĄDZENIA MOBILNE (TELEFONY DO 767px) --- */
@media (max-width: 767px) {
    .parallax-bg {
        /* Centrujemy tło, wyłączamy boki i zostawiamy zapas tylko na pionowy scroll */
        top: -10vh;
        left: 0;
        width: 100vw;
        height: 200vh;
        background-size: cover;
        transform: translateY(calc(var(--scroll-y, 0px) * -0.08));
    }
    #menu-toggle {
        display: flex; 
    }
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px);
        background: #161b22;
        flex-direction: column;
        align-items: flex-start;
        padding: 30px;
        gap: 20px;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
    }
    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .nav-item {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    .nav-item > a {
        font-size: 1.3rem;
        padding: 10px 0;
        width: 100%;
        border-bottom: 1px solid #30363d;
    }
    .nav-item:hover .navbar-dropdown {
        transform: none !important;
        opacity: 1;
        visibility: visible;
    }
    .navbar-dropdown {
        position: relative;
        top: 0;
        left: 0;
        transform: none !important;
        background: transparent;
        border: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: block;
        padding: 5px 0 5px 20px;
        width: 100%;
    }
    .navbar-dropdown li a {
        padding: 8px 0;
        font-size: 1rem;
        color: #8b949e;
    }
    #space-container {
        margin-top: 110px !important;
        margin-bottom: 260px !important;
    }
}

/* --- 2. TABLETY I ŚREDNIE EKRANY (768px - 1199px) --- */
@media (min-width: 768px) and (max-width: 1199px) {
    #space-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 140px 30px; 
        padding: 100px 80px; 
        justify-items: center;
        align-items: center;
        margin-top: 110px !important;
    }
    .node-container {
        grid-column: auto !important;
    }
}

/* --- 3. DUŻE EKRANY DESKTOP (OD 1200px) --- */
@media (min-width: 1200px) {
    #space-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
        padding: 140px 200px; 
        /*grid-template-columns: repeat(4, 1fr); 
        padding: 100px 100px; */
        gap: 160px 40px; 
        justify-items: center;
        align-items: center;
    }
    .node-container {
        grid-column: auto !important;
    }
}

/* ========================================================
   STYLOWANIE ETYKIET (BADGES) DLA PODMENU
   ======================================================== */

/* Bazowa klasa etykiety - wspólna dla obu typów menu */
.item-badge {
    position: absolute;      /* Pozycjonowanie niezależne na okręgu podmenu */
    top: -14px;              /* Uniesienie etykiety nad owalny przycisk podmenu */
    left: 50%;
    transform: translateX(-50%); /* Idealne centrowanie w poziomie nad przyciskiem */
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    pointer-events: none;    /* Ignorowanie kliknięć myszką, by nie blokować linku pod spodem */
    z-index: 20;             /* Wyrzucenie etykiety nad wszystkie inne elementy orbity */
}

/* Nadpisanie pozycjonowania dla etykiet wewnątrz górnego paska/rozwijanego menu */
.inline-badge {
    position: relative;      /* W menu tekstowym etykieta układa się naturalnie obok tekstu */
    top: -1px;
    left: 0;
    transform: none;         /* Reset centrowania z wersji orbitalnej */
    margin-left: 8px;        /* Odstęp od tekstu linku z lewej strony */
    display: inline-block;
    vertical-align: middle;
}

/* Wariant kolorystyczny: NOWOŚĆ (zielony) */
.badge-nowość {
    background-color: #238636;
    color: #ffffff;
    border: 1px solid #2ea44f;
}

/* Wariant kolorystyczny: W PRZYGOTOWANIU (pomarańczowy/żółty) */
.badge-w-przygotowaniu {
    background-color: #d29922;
    color: #0d1117;
    border: 1px solid #f0b73f;
}
