body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #eee;
}

.hidden {
    display: none;
}

.thumbnail img.hidden-image {
    visibility: hidden !important;
    background-color: white !important;
}


.loading {
    position: relative;
}

.loading img {
    visibility: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #000;
    border-radius: 50%;
    z-index: 2;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    opacity: 0;
    transition: opacity 1s;
}

.fade-in.show {
    opacity: 1;
}


header {
    width: 100%;
    padding: 20px;
    background: linear-gradient(to right, #333, #555);
    color: #fff;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.logo {
    margin: auto;
}

.logo h1 {
    margin: 0;
    font-size: 2em;
    color: #00c3ff;
}

.auth-buttons a,
.auth-buttons button {
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    background-color: #00c3ff;
    color: #333;
    border: none;
    cursor: pointer;
}

.auth-buttons a:hover,
.auth-buttons button:hover {
    background-color: #00a1cc;
}

.site-description {    
    margin: 10px;
    font-size: 1.2em;
}

#header {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
}

#login-icon {
    text-decoration: none;
    color: #000;
    background: #ddd;
    padding: 5px 10px;
    border-radius: 5px;
}

#login-icon:hover {
    background: #ccc;
}


.filters {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 10px;
    max-width: 80%;
    margin: 10px auto;
    justify-content: center;
}

.filter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #444;
    padding: 10px;
    border-radius: 8px;
    max-width: 300px;
    min-width: 12vw;
}

.filter-item label {
    color: #fff;
    margin-bottom: 5px;
}

.filter-item select {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}


.admin-buttons {
    margin-top: 10px;
}

.admin-buttons button {
    margin: 5px;
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
}

.admin-buttons button:hover {
    background-color: #0056b3;
}

.admin-only {
    display: none;
}



main {
    width: 90%;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}


.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.visible {
    opacity: 1;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 90vh;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
}

.lightbox img {
    max-height: 70vh;
    width: 100%;
    object-fit: contain;
    display: block;
}

.text-container {
    text-align: left;
    color: #fff;
    max-width: 80vw;
    align-self: start;
    margin-top: 20px;
    max-height: 40vh;
    overflow-y: auto;
}

.text-container h2 {
    margin-top: 0px;
    font-size: 1.4em;
    margin-bottom: 10px;
}

.text-container h3 {
    margin: 5px 0;
    font-style: italic;
    font-size: 1em;
    margin-bottom: 10px;
}

.text-container p {
    margin: 5px 0;
    font-size: 1em;
    line-height: 1.4em;
}

@media (max-width: 768px) {
    .text-container {
        max-width: 100%;
    }
    .text-container p {
        font-size: 0.8em;
        line-height: 1.2em;
    }    
    .lightbox img {
        max-height: 60vh;
    }
}


.thumbnail {
    cursor: pointer;
    position: relative;
    width: 100%;
    background-color: #f0f0f0;
    overflow: hidden;    
}

@media (min-width: 1080px) {
	.thumbnail {
		aspect-ratio: 16 / 9;
	}
}



.thumbnail img {
    display: block;    
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;    
    opacity: 0; /* Initially hide the image */
    transition: opacity 1s; /* Fade-in effect */
}

.thumbnail img[srcset] {
    opacity: 1; /* Show the image when srcset is set */
}

.thumbnail.loading img {
    visibility: visible; /* Show the placeholder image */
}

.thumbnail .button-container {
    position: absolute;
    bottom: -60px; /* Initially hide the buttons below the thumbnail */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
    transition: bottom 0.3s ease, opacity 0.3s ease, visibility 0.3s ease; /* Smooth slide effect */
    opacity: 0; /* Initially invisible */
    visibility: hidden; /* Initially not visible */
}

.thumbnail:hover .button-container {
    bottom: 10px; /* Slide the buttons into view */
    opacity: 1; /* Make the buttons visible */
    visibility: visible; /* Make the buttons visible */
}

.thumbnail button {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    margin: 5px;
}


#login-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#login-form input {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ccc;
}

#login-form button {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

#login-form button:hover {
    background: #45a049;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.login-box {
    background: #fff;
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.input-group {
    margin-bottom: 15px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

button[type="submit"] {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #28a745;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button[type="submit"]:hover {
    background: #218838;
}

.error-message {
    color: #d9534f;
    margin-top: 10px;
}
