@media (min-width: 751px) {
    #sidebar, 
    .col-md-3,
    .col-lg-2 {
        min-width: 280px !important; /* stała minimalna szerokość */
        width: 280px !important;
        flex: 0 0 280px !important;
    }

    main.col-md-9,
    main.col-lg-10 {
        width: calc(100% - 280px) !important;
        flex: 0 0 calc(100% - 280px) !important;
        max-width: calc(100% - 280px) !important;
    }
}

body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

#sidebar {
    position: sticky;
    top: 0;
    left: 0;
    height: 100vh;
    min-height: 100vh;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding-top: 20px;
    overflow: hidden;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    padding: 20px 0;
}

.sidebar-header .logo {
    max-width: 70%;
    margin-bottom: 5px;
}

.sidebar-header h3 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.sidebar-header h4 {
    font-size: 1.2em;
    color: #bdc3c7;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
    padding: 0 15px;
}

.search-box input {
    background-color: #34495e;
    border: none;
    color: #ecf0f1;
    padding-right: 30px;
}

.search-box i {
    position: absolute;
    right: 25px;
    top: 10px;
    color: #bdc3c7;
}

#sidebar-menu ul {
    padding-left: 0;
}

#sidebar-menu ul li {
    list-style: none;
}

#sidebar-menu ul li a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 20px; /* Zwiększamy rozmiar czcionki */
    padding: 8px 15px;
}

#sidebar-menu ul li a:hover,
#sidebar-menu ul li a.active {
    background-color: #34495e;
}

#sidebar-menu ul ul {
    padding-left: 20px;
}

#sidebar-menu ul ul li a {
    font-size: 18px; /* Rozmiar czcionki dla podmenu */
}

main {
    padding-top: 20px;
}

.breadcrumb {
    background-color: transparent;
    padding-left: 0;
}

.content h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.content h2 {
    color: #34495e;
    margin-bottom: 15px;
}

.content p, .content ul {
    font-size: 18px;
    color: #000;
    line-height: 1.6;
}

/* by menu było zawsze widoczne, nawet na małych ekranach: */
/* @media (max-width: 767.98px) { */
@media (max-width: 750px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        padding: 48px 0 0;
        box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
        overflow-y: auto;
    }
    
    main {
        padding-top: 48px; /* Dodaj padding na górze, aby treść nie była zasłonięta przez menu */
    }
}

@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        width: 100%;
        max-width: 80%;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
        width: 100%;
    }

    .content {
        padding-top: 60px;
    }

    .navbar-toggler {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 101;
    }
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        bottom: 0;
        z-index: 1000;
        width: 80%;
        max-width: 300px;
        transition: all 0.3s;
        overflow-y: auto;
    }

    #sidebar.active {
        left: 0;
    }

    .content {
        width: 100%;
        padding-top: 60px; /* Miejsce na przycisk menu */
    }

    #sidebarToggle {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background-color: #343a40;
        border: none;
        color: white;
        padding: 10px;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }

    main {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (min-width: 768px) {
    #sidebarToggle {
        display: none;
    }
}

.instruction-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.instruction-link:hover {
    text-decoration: underline;
}



/* lightbox style */
#lightboxOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
#lightboxContainer {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
#lightboxContainer img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
}
#lightboxContainer button {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
}
#lightboxClose {
    top: 10px;
    right: 10px;
}
#lightboxPrev {
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}
#lightboxNext {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}
.lightbox-caption {
    text-align: center;
    color: white;
    margin-top: 10px;
}
.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    background-color: #2c3e50;
}

/* Dla obrazków mniejszych niż 400px - max 1.5x powiększenie */
img.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Specjalna klasa dla małych obrazków */
img.img-fluid[width="50%"] {
    max-width: 50%;
}

/* Dodatkowa kontrola dla małych obrazków */
@media (min-width: 768px) {
    img.img-fluid[width="50%"] {
        max-width: min(50%, 600px); /* Ogranicza do 50% szerokości kontenera lub 600px, cokolwiek jest mniejsze */
    }
}

.instruction-tile {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.instruction-tile h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 15px;
}
.instruction-tile h4 {
    font-size: 1.2em;
    color: #34495e;
    margin-bottom: 10px;
}
.instruction-tile p {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
}
.instruction-tile img {
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    margin-bottom: 15px;
}


/* Menu */
#sidebar-menu {
    height: calc(100vh - 270px); /* Wysokość - (nagłówek + stopka) */
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
    /* margin-bottom: 60px;   */
    background-color: #2c3e50;
}

/* Submenu */
.submenu li a {
    padding-left: 40px !important;
    font-style: italic;
}

/* Scrollbar */
#sidebar-menu::-webkit-scrollbar {
    width: 8px;
}

#sidebar-menu::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

#sidebar-menu::-webkit-scrollbar-track {
    background-color: #2c3e50;
}

/* Stopka */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Nieznacznie zwiększamy */
    padding: 10px;
    background-color: #343a40 ;
    border-top: 1px solid #34495e;
    text-align: center;
}

.sidebar-footer .copyright {
    color: #d5d5d6;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.sidebar-footer .app-link a {
    color: #3498db;
    font-size: 0.8em;
    text-decoration: none;
}

.sidebar-footer .app-link a:hover {
    color: #2980b9;
    text-decoration: underline;
}