/* main flexbox */
body {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: space-between;
    background-color: #f0f0f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* h1 i footer */
h1 {
    margin-top: 30px;
    color: #2c3e50;
    text-align: center;
}

p.footer {
    margin-bottom: 30px;
    color: #7f8c8d;
    font-size: 0.9em;
    text-align: center;
}

/* polenglish */
#lang-switch {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    font-size: 0.9em;
}

.lang-btn {
    color: #7f8c8d;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    transition: color 0.2s, background-color 0.2s;
}

.lang-btn:hover {
    color: #2c3e50;
}

.lang-btn.active {
    color: #2c3e50;
    background-color: #e0e0e0;
    cursor: default;
}

.separator {
    color: #7f8c8d;
    margin: 0 5px;
}

/* MAIN */
main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%; 
    max-width: 800px; 
    padding: 20px;
    box-sizing: border-box;
}

/* caly content box */
.content-box {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    line-height: 1.6;
    box-sizing: border-box;
}

/* h2 i ul */
.content-box h2 {
    color: #3498db;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 5px;
    margin-top: 0;
}

.content-box ul {
    list-style-type: square;
    margin-left: 20px;
}

/* buttony i hrefy */
p.center-link {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Podstawowy zielony przycisk */
a.button-link, button.button-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    line-height: normal;
    text-align: center;
}

a.button-link:hover, button.button-link:hover {
    background-color: #27ae60;
}

/* formularz rozwin */
.button-link.secondary {
    background-color: #3498db;
}

.button-link.secondary:hover {
    background-color: #2980b9;
}

/* container przyciski */
.buttons-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* caly formularz */
#register-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    text-align: left;
    animation: fadeIn 0.5s;
}

#register-form label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
}

#register-form input, 
#register-form textarea, 
#register-form select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

/* daj mi swoje dane */
#register-form button[type="submit"] {
    margin-top: 20px;
    width: 100%;
}

/* formularz sukces i blad */
#form-message {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    min-height: 1.2em;
}

.msg-success { color: #2ecc71; }
.msg-error { color: #e74c3c; }

/* zajebisty fadein */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- GALERIA --- */

.gallery-main {
    max-width: 1000px; /* Szerszy widok dla galerii */
}

/* Nawigacja okruszkowa */
.breadcrumbs {
    background: #ffffff;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.95em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    color: #7f8c8d;
}

.crumb-item {
    cursor: pointer;
    color: #3498db;
    font-weight: bold;
}

.crumb-item:hover {
    text-decoration: underline;
}

.crumb-separator {
    margin: 0 8px;
    color: #ccc;
}

.crumb-active {
    color: #333;
    cursor: default;
    font-weight: normal;
}

/* Grid folderów i zdjęć */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Pojedynczy kafelek (folder lub zdjęcie) */
.gallery-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1 / 1; /* Kwadratowe kafelki */
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Wygląd Folderu */
.folder-icon {
    flex: 1;
    background-color: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: #3498db;
}

.folder-name {
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    background: #fff;
    border-top: 1px solid #eee;
    color: #333;
}

/* Wygląd zdjęcia w siatce */
.photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ważne: przycina zdjęcie do kwadratu bez deformacji */
    transition: filter 0.3s;
}

.gallery-item:hover .photo-thumb {
    filter: brightness(0.9);
}

/* --- LIGHTBOX (Pełny ekran) --- */
.lightbox {
    display: none; /* Domyślnie ukryty */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

#lightbox-caption {
    color: #ccc;
    margin-top: 10px;
    text-align: center;
    font-family: sans-serif;
    position: absolute;
    bottom: -30px;
    width: 100%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #e74c3c;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 30px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 5px;
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.prev { left: 20px; }
.next { right: 20px; }

/* Ukrywanie przycisków na mobilkach jeśli przeszkadzają, ale tu zostawimy */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .lightbox-nav {
        padding: 10px;
        font-size: 20px;
    }
}

/* Kontener zdjęcia musi ukrywać wystające fragmenty po powiększeniu */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Ważne dla zoomu */
    cursor: zoom-in;
}

#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    transition: transform 0.3s ease; /* Płynne przybliżanie */
    user-select: none;
    -webkit-user-drag: none;
}

/* Klasa aktywowana przez JS po kliknięciu */
.lightbox-img-zoomed {
    cursor: grab;
    transform: scale(2.5); /* Poziom przybliżenia (możesz zmienić) */
}

.lightbox-img-zoomed:active {
    cursor: grabbing;
}
