﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background: url('../images/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    font-size: 2.5rem;
    color: #1A2E4B;
    margin: 40px 0 40px;
    font-weight: bold;
}

h2 {
    font-size: 2rem;
    color: #1A2E4B;
    margin: 10px 0;
    font-weight: bold;
}

h3 {
    font-size: 1.5rem;
    color: #1A2E4B;
    margin: 5px 0;
    font-weight: bold;
}

p[data-lang-key] {
    margin-top: 50px;
}

header {
    background: #1A2E4B;
    color: white;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header img {
    height: 50px;
    cursor: pointer;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
}

nav a:hover {
    color: #F28C38;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    color: white;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
}

.dropdown-btn:hover {
    color: #F28C38;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #1A2E4B;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    font-weight: normal;
    background: #1A2E4B;
}

.dropdown-content a:hover {
    background: rgba(242, 140, 56, 0.3);
    color: white;
    border-radius: 5px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.contact-btn {
    background: #F28C38;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    font-weight: bold;
    margin: 0 5px;
    border: none;
}

.contact-btn:hover {
    filter: brightness(1.1);
}

.lang-switcher {
    cursor: pointer;
    color: #F28C38;
    font-weight: bold;
    padding: 4px 12px;
    margin-left: 10px;
}

.lang-switcher:hover {
    color: #e07b30;
}

main {
    margin-top: 80px;
    padding: 20px;
    flex: 1;
    background: linear-gradient(135deg, #F5F6F5 0%, #E8ECEF 100%);
    border-radius: 8px;
    margin: 20px 20px 100px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.product {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 280px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.product:hover {
    transform: translateY(-5px);
}

.product img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.product p {
    margin: 10px 0;
    font-size: 14px;
    color: #333;
}

.panels {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 280px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s;
}

.panel:hover {
    transform: translateY(-5px);
}

.panel img {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 10px;
}

.panel p {
    font-size: 14px;
    color: #333;
    margin: 10px 0;
}

.tree {
    margin: 20px 0;
}

details {
    margin: 10px 0;
    padding-left: 20px;
}

summary {
    cursor: pointer;
    font-weight: bold;
    padding: 10px;
    background: #1A2E4B;
    color: white;
    border-radius: 4px;
    transition: background 0.2s;
}

summary:hover {
    background: #F28C38;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: '▼';
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.2s;
}

details[open] summary::before {
    transform: rotate(180deg);
}

.node {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.node-text {
    flex: 2;
    padding-right: 20px;
}

.node-image {
    flex: 1;
    text-align: center;
}

.node-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.2s;
}

.node-image img:hover {
    transform: scale(1.05);
}

.changelog {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.changelog ul {
    list-style: none;
    padding: 0;
}

.changelog li {
    margin: 10px 0;
    padding: 10px;
    border-left: 3px solid #F28C38;
}

footer {
    background: #1A2E4B;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
}

.popup form {
    display: flex;
    flex-direction: column;
}

.popup input,
.popup textarea {
    margin: 8px 0;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.popup textarea {
    resize: vertical;
    min-height: 80px;
}

.popup button {
    background: #F28C38;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

.popup button:hover {
    filter: brightness(1.1);
}

.popup .close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
}

.popup .close:hover {
    color: #F28C38;
}

/* Style dla acc-viewer.html */
.acc-viewer-container {
    max-width: 800px;
    width: 100%;
    text-align: left; /* Zmiana na wyrównanie do lewej */
    margin: 0 20px; /* Wyrównanie do lewej z marginesem */
}

.modal {
    display: flex !important; /* Zapewnia widoczność modala */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Wyższy z-index niż header */
}

.modal[data-persistent="true"] {
    display: flex !important; /* Maksymalny priorytet dla widoczności */
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
}

.modal-content .close:hover {
    color: #F28C38;
}

/* Styl dla całego kontenera drzewka */
#tree-container {
    width: 100%;
    margin: 0; /* Wyrównanie do lewej */
    font-family: Arial, sans-serif;
    background-color: #f0f0f0; /* Szare pole dla całego drzewka */
    padding: 10px 0; /* Padding tylko góra/dół */
    border-radius: 4px;
}

/* Styl dla sekcji hubów */
.hub-section {
    margin-bottom: 20px; /* Podział poziomy między hubami */
    border-bottom: 1px solid #ccc; /* Linia podziału */
    padding-bottom: 10px;
}

.hub-section h2 {
    margin: 0 0 10px 0;
    color: #005E99;
    font-size: 1.2em;
}

/* Styl dla drzewka */
.tree {
    list-style-type: none;
    padding-left: 0;
}

/* Styl dla węzłów hubów i projektów */
.tree-node.hub, .tree-node.project {
    margin-bottom: 5px;
}

.tree-node.hub .tree-node-label, .tree-node.project .tree-node-label {
    background-color: transparent; /* Usunięcie niebieskiego tła */
    color: #005E99; /* Niebieski tekst zamiast białego */
    padding: 4px 8px; /* Mniejszy padding */
    display: inline; /* Zmiana na inline, aby nie zachowywało się jak blok */
    border-radius: 0; /* Usunięcie zaokrągleń */
    cursor: pointer;
    transition: color 0.3s ease; /* Zmiana koloru zamiast tła */
}

.tree-node.hub .tree-node-label:hover, .tree-node.project .tree-node-label:hover {
    color: #FF6200; /* Pomarańczowy tekst po najechaniu */
    background-color: transparent; /* Bez tła */
}

/* Styl dla niższych poziomów (foldery, zawartość, wersje) */
.tree-node.folder, .tree-node.item, .tree-node.version {
    margin-bottom: 2px;
}

.tree-node.folder .tree-node-label, .tree-node.item .tree-node-label, .tree-node.version .tree-node-label {
    color: #002060; /* Granatowy tekst */
    padding: 4px 8px;
    display: inline; /* Zmiana na inline */
    cursor: pointer;
}

/* Styl dla dzieci węzłów (wcięcia) */
.tree-node-children {
    list-style-type: none;
    padding-left: 20px;
}

/* Styl dla li jako kontenerów */
li.tree-node {
    margin: 2px 0;
}

/* Styl dla komunikatu błędu */
#error-message {
    color: red;
    display: none;
    margin: 10px 0;
    text-align: center;
}

/* Styl dla przycisku generowania CSV */
.contact-btn[data-lang-key="generate_csv_button"] {
    display: none;
    margin: 20px 0 0 0; /* Wyrównanie do lewej */
    padding: 10px 20px;
    background-color: #005E99;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left; /* Wyrównanie tekstu w przycisku do lewej */
}

.contact-btn[data-lang-key="generate_csv_button"]:hover {
    background-color: #FF6200;
}
/* Styl dla checkboxów */
.folder-checkbox {
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

.tree-node-label {
    cursor: pointer;
    user-select: none; /* Zapobiega zaznaczaniu tekstu przy kliknięciu */
}
/* Animacja ładowania */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #005E99;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

@media screen and (max-width: 600px) {
    header {
        flex-direction: column;
        padding: 10px;
    }

    nav {
        flex-direction: column;
        align-items: center;
    }

    nav a,
    .contact-btn,
    .lang-switcher,
    .dropdown-btn {
        margin: 5px 0;
        padding: 6px 10px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        background: #1A2E4B;
        width: 100%;
        text-align: center;
    }

    .dropdown-content a {
        padding: 6px 0;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .product,
    .panel {
        width: 100%;
        max-width: 300px;
    }

    .node {
        flex-direction: column;
        align-items: center;
    }

    .node-text,
    .node-image {
        padding: 10px;
        text-align: center;
    }

    main {
        margin: 100px 10px 80px;
        padding: 15px;
    }

    .acc-viewer-container {
        padding: 10px;
        margin: 0 10px; /* Wyrównanie do lewej z marginesem */
    }

    .modal-content {
        width: 95%;
        max-width: 350px;
        padding: 15px;
    }
}