/* Stylizacja galerii i lightboxa */


body {
    font-family: Arial, sans-serif;
	color: darkblue;
    background-color: #C7D8F2; 
	/*max-width: 1024px;          limit szerokości */
	max-width: 1090px;
    margin: 0 auto;
	/*margin: auto 10px auto;*/
	padding: 0;

	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}


/* Styl dla button, identyczny jak w przykładowym label */
.custom-button, .ok, .cancel, .confirm, .close_upload {
    padding: 5px 20px !important; /* Wewnętrzny odstęp */
    background-color: #e6e6e6 !important; /* Kolor tła */
	border-top: 2px solid #fff !important; /* Ramka na górze */
    border-left: 2px solid #fff !important; /* Ramka po lewej */
	border-bottom: 2px solid #282828 !important; /* Ramka na dole */
    border-right: 2px solid #282828 !important; /* Ramka po prawej */
    border-radius: 5px !important; /* Zaokrąglone rogi */
    cursor: pointer !important; /* Kursor wskazujący */
    font-size: 12px !important; /* Rozmiar czcionki */
    color: darkblue !important; /* Kolor tekstu */
    font-weight: bold !important; /* Pogrubienie tekstu */
    text-align: center !important; /* Wyśrodkowanie tekstu */
    transition: background-color 0.3s, transform 0.1s !important; /* Płynne przejścia */
}

/* Efekt po najechaniu myszką */
.custom-button:hover, .ok:hover, .cancel:hover, .confirm:hover, .close_upload:hover {
    color: red !important;
}

/* Efekt po kliknięciu */
.custom-button:active, .ok:active, .cancel:active, .confirm:active, .close_upload:active {
	border-top: 2px solid #282828 !important;
    border-left: 2px solid #282828 !important;
	border-bottom: 2px solid #fff !important;
    border-right: 2px solid #fff !important;
}

/* Ukryj domyślny input wyboru plików */
#photo-input {
    display: none;
}
.custom-file-upload {
    display: inline-block;
    padding: 5px 20px;
    background-color: #e6e6e6;
	border-top: 2px solid #fff;
    border-left: 2px solid #fff;
	border-bottom: 2px solid #282828;
    border-right: 2px solid #282828;
	border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: darkblue;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.3s;
}

.custom-file-upload:hover {
	color: red;
}

.custom-file-upload:active {
	border-top: 2px solid #282828; 
    border-left: 2px solid #282828;
	border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
}

.custom-file-upload.disabled, #upload-button.disabled, .cancel.disabled {
	background-color: #bebebe !important;
	color: #8c8c8c !important;
	border-top: 2px solid #f0f0f0 !important; 
    border-left: 2px solid #f0f0f0 !important;
	border-bottom: 2px solid #5a5a5a !important;
    border-right: 2px solid #5a5a5a !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
} 

.overlay-text {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);

    max-width: 1070px;  /* 1024    1070 - 20 */
    width: calc(100% - 20px); /* marginesy po 10px */
    height: 60px;
    padding-bottom: 10px;

    border-bottom: 1px solid darkblue;
    background-color: #C7D8F2;

    font-size: clamp(24px, 3vw, 36px);
    font-weight: bold;

    display: flex;
    justify-content: center;
    align-items: flex-end;

    z-index: 100;
}


#navbar {
    position: fixed;
    top: 0;  
    height: 70px;
  /*left: 0;
	right: 0;
	max-width: 1024px;*/
	max-width: 1070px;
	width: 100%;
    margin: 0 auto;
	background-color: transparent; 
    display: flex;
    justify-content: space-between;
    padding: 5px 20px 0 20px; 
    box-sizing: border-box;/*  */
	z-index: 101;
}


#navbar button {
    border: 1px solid darkblue;
    border-radius: 4px;
    padding: 2px 5px 2px 5px;
    color: darkblue;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
#navbar button:hover {
    color: red;
}



#stopka {
    font-size: 12px;
    font-style: italic;
	font-weight: normal;
    color: darkblue;
    text-align: center;
    vertical-align: middle;
}

#stopka a {
    color: darkblue; 
    text-decoration: none;
}

#stopka a:hover {
    color: #FF0000;
}

.lingal {
    display: flex;
   justify-content: center;
  /*   flex-direction: row;*/
	flex-wrap: wrap;
	gap: 10px 50px;
    /*max-width: 1024px;*/
    max-width: 1070px;
    width: 100%;
	margin: 10px auto;
    padding: 5px;
    font-size: 12px;
    font-style: normal;
    font-weight: bold;
    box-sizing: border-box;
}

.lingal button {
    border: 1px solid darkblue;
    border-radius: 4px;
    padding: 2px;
    color: darkblue;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.lingal button:hover {
    color: red;
}


/* Styl dla galerii zdjęć */
.gallery {
    margin: 70px 10px 0 10px;  /* wycentrowanie */
    background-image: url("images/tlo.jpg");
    /*max-width: 1024px;*/         
    max-width: 1070px;         
    min-height: 330px;
    border: 1px solid darkblue;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
	align-self: flex-start;
	gap: 10px;
    padding: 10px;
}

.none {
    align-self: center;
    width: 100%;               /* limit szerokości rodzica, zajmuje całą szerokość kontenera */
    min-height: 10px;        /* widoczny pusty div */
    padding: 0;
	background-color: transparent;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: red;
}



/* Styl dla miniaturek zdjęć */
.thumbnail {
    width: auto;
    height: 100px;
    border: 1px solid darkblue;
    padding: 3px;
    cursor: pointer;
}

/* Efekt powiększenia miniaturki */
.thumbnail:hover {
    transform: scale(1.07);
    padding: 2px;
    border: 2px solid red;
}

/* Styl dla lightboxa przeglądania zdjęć */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
}

/* Styl dla kontenera lightboxa przeglądania zdjęć */
.lightbox-container {
    background: #f0f0f0;
    padding: 5px 5px 20px; /*  15px  */
    border-radius: 5px; /* 10px */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    max-width: 95%;   /*max-width: 90%;*/
    max-height: calc(95vh - 20px);   /*max-height: calc(90vh - 20px);*/
    top: 20px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Styl dla obrazu w lightboxie przeglądania zdjęć */
.lightbox img#lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 100px);   /*max-height: calc(100vh - 20px - 30px - 6px - 60px - 30px);*/
    height: auto;
    object-fit: contain;
    border: 3px solid darkblue;
    border-radius: 5px;
    z-index: 999;
}

/* Styl dla przycisków (zamknij, pobierz, poprzedni, następny) */
.close, .download, .prev, .next, .delete {
    position: absolute;
    cursor: pointer;
    z-index: 1001;
 	opacity: 0.2;
}

/* Styl dla przycisku zamykania */
.close {
    top: 6px; /* 10px; */
    right: 4px; /* 10px; */
    /* width: 30px; 40px; */
    /* height: 30px; 40px; */
}

/* Styl dla przycisku pobierania */
.download {
    bottom: 18px; /* 10px; */
    right: 3px; /* 10px; */
    /* width: 77px; 103px; */
    /* height: 30px;  40; */
}

.delete {
    top: 6px;
    left: 4px;
    /* width: 60px; 80px; */
    /* height: 30px; 40; */
}

/* Styl dla przycisków poprzedni/następny */
.prev, .next {
    width: 40px; /* 30; */
    height: 40px; /* 30; */
    top: 50%;
    transform: translateY(-50%);
}

/* Pozycja przycisku poprzedni */
.prev {
   left: 4px;
}

/* Pozycja przycisku następny */
.next {
    right: 4px;
}

/* Fallback tekstowy dla debugowania przycisków, ukryty domyślnie */
.prev::after, .next::after {
    display: none;
    font-size: 24px;
    color: #333;
    position: absolute;
}

/* Tekst dla przycisku poprzedni */
.prev::after {
    content: '←';
}

/* Tekst dla przycisku następny */
.next::after {
    content: '→';
}

/* Styl dla obszarów klikalnych (lewa/prawa połowa) */
.prev-area, .next-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    z-index: 1000;
}

/* Obszar dla poprzedniego zdjęcia */
.prev-area {
    left: 0;
}

/* Obszar dla następnego zdjęcia */
.next-area {
    right: 0;
}

.next-area:hover ~ .close {
    opacity: 0.6;
}
.prev-area:hover ~ .close {
    opacity: 0.6;
}
.next-area:hover ~ .download {
    opacity: 0.6;
}
.prev-area:hover ~ .download {
    opacity: 0.6;
}
.next-area:hover ~ .delete {
    opacity: 0.6;
}
.prev-area:hover ~ .delete {
    opacity: 0.6;
}
.next-area:hover ~ .next {
    opacity: 0.6;
}

.prev-area:hover ~ .next {
    opacity: 0.6;
}
.next-area:hover ~ .prev {
    opacity: 0.6;
}

.prev-area:hover ~ .prev {
    opacity: 0.6;
}

.close:hover {
	opacity: 1;
} 
.download:hover {
	opacity: 1;
} 
.delete:hover {
	opacity: 1;
} 
.next:hover {
	opacity: 1;
} 
.prev:hover {
	opacity: 1;
}

/* Styl dla licznika zdjęć */
.image-counter {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    color: darkblue;
    font-size: 12px;
    font-weight: normal;
    z-index: 1001;
    display: block;
}

/* Styl dla lightboxa logowania */
.login-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
}

/* Styl dla kontenera lightboxa logowania */
.login-lightbox-container {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    width: 300px;
    top: 20px;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
	text-align: center;
font-weight: bold;
color: red;

}

/* Styl dla formularza w lightboxie logowania */
.login-lightbox form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Styl dla kontenera przycisków w formularzu logowania */
.login-lightbox .login-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Styl dla pól input w lightboxie logowania i wgrywania */
.login-lightbox input, .upload-lightbox input {
    padding: 8px;
    font-size: 14px;
    border: 1px solid darkblue;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}

/* Styl dla lightboxa wgrywania */
.upload-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
}

/* Styl dla kontenera lightboxa wgrywania */
.upload-lightbox-container {
    background: #f0f0f0; 
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    width: 400px;
    top: 20px;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
justify-content: center;
    height: auto;
}

/* Styl dla formularza w lightboxie wgrywania */
.upload-lightbox form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Styl dla kontenera przycisków w formularzu wgrywania */
.upload-lightbox .upload-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

/* Styl dla przycisku zamknij w lightboxie wgrywania */
.upload-lightbox button.close_upload {
    display: none;
    margin: 0 auto;
}

/* Styl dla komunikatu o limicie plików */
.upload-lightbox .file-limit-message {
    color: #000;
    font-size: 14px;
font-weight: bold;
    margin: 5px 0;
    text-align: center;
}

/* Styl dla komunikatu o przekroczeniu limitu */
.upload-lightbox .file-limit-message.warning {
    color: red;
}

/* Styl dla listy wybranych plików */
.upload-lightbox .file-list {
    width: 100%;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 1px; /* 5 */
}

/* Styl dla pojedynczego elementu listy plików */
.upload-lightbox .file-item {
    width: 100%;
}

/* Styl dla siatki w elemencie listy plików */
.upload-lightbox .file-grid {
    display: grid;
    grid-template-columns: 40px 150px 1fr 30px; /* Kolumny: miniatura (40px), nazwa (150px), status (reszta), przycisk (30px) */
    align-items: center;
    padding: 2px; 
    font-size: 12px;
    font-family: Arial, sans-serif;
}

/* Styl dla miniaturki w siatce */
.upload-lightbox .file-grid-thumbnail img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border: 1px solid darkblue;
}

/* Styl dla nazwy pliku w siatce */
.upload-lightbox .file-grid-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 5px;
    color: darkblue;
}

/* Styl dla statusu w siatce */
.upload-lightbox .file-grid-status {
    padding-left: 10px;
    color: #333;
}

/* Styl dla statusu sukcesu w siatce */
.upload-lightbox .file-grid-status.success {
    color: #008000;
    font-weight: bold;
}

/* Styl dla statusu błędu w siatce */
.upload-lightbox .file-grid-status.error {
    color: #ff0000;
    font-weight: bold;
}

/* Styl dla przycisku usuwania w siatce */
.upload-lightbox .file-grid-remove {
    text-align: center;
}

/* Styl dla przycisku usuwania pliku */
.upload-lightbox .remove-file {
    background-color: #ff0000;
    color: #fff;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: inline-block;
}

/* Styl dla przycisku zamykania */
.close_upload {
    bottom: 10px;
    left: 50%;
}

/* Styl dla lightboxa usuwania */
.delete-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
}

/* Styl dla kontenera lightboxa usuwania */
.delete-lightbox-container {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    max-width: 400px;
    top: 20px;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
	text-align: center;
}

/* Styl dla wiadomości w lightboxie usuwania */
#delete-message {
    font-size: 16px;
    color: darkblue;
    margin-bottom: 20px;
    text-align: center;
}

/* Styl dla wiadomości o sukcesie */
#delete-message.success {
    color: #008000;
    font-weight: bold;
}

/* Styl dla wiadomości o błędzie */
#delete-message.error {
    color: #ff0000;
    font-weight: bold;
}

/* Styl dla kontenera przycisków w lightboxie usuwania */
.delete-lightbox .delete-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}


@media (max-width: 500px) {
    .gallery {
        padding: 5px; 
        gap: 5px; 
    }

    .thumbnail {
        height: 80px; 
    }

    .upload-lightbox-container {
        width: 90%; 
        padding: 10px; 
        min-height: 250px; 
    }

    .custom-file-input #file-status {
        font-size: 12px; 
    }

    .file-limit-message {
        font-size: 12px; 
    }

    .file-grid {
        grid-template-columns: 30px 100px 1fr 20px; 
        font-size: 10px; 
        padding: 3px; 
    }

    .file-grid-thumbnail img {
        width: 20px; 
        height: 20px;
    }

    .file-grid-remove span {
        width: 16px; 
        height: 16px;
        line-height: 16px;
        font-size: 10px;
    }
}