body {
    background-color: #000000;
    color: #ffffff;
    text-align: center; /* Center-align text for a cleaner look */
}

/* --- BUTTON STYLES --- */
.GreyButton, .GreenButton, .BlueButton, .btn-customized {
    display: inline-block;
    cursor: pointer;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.GreyButton {
    background-color: #5c5c5c;
    border-color: #8a8a8a;
}
.GreyButton:hover { background-color: #474747; }

.GreenButton {
    background-color: #5a8e44;
    border-color: #76c442;
}
.GreenButton:hover { background-color: #4e7d3a; }

.BlueButton {
    background-color: #476e9e;
    border-color: #7892c2;
    padding: 10px 30px;
}
.BlueButton:hover { background-color: #3a598a; }

.btn-customized {
    background-color: #444;
    border-color: #666;
}
.btn-customized:hover {
    background-color: #555;
}

.GreyButton:active, .GreenButton:active, .BlueButton:active, .btn-customized:active {
    transform: translateY(1px);
}

/* --- LAYOUT & CONTAINERS --- */
.content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px; /* Limit form width on larger screens */
}

.form-container .form-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.form-label {
    flex-basis: 100px;
    text-align: right;
    margin-right: 1rem;
}

.form-container input[type="text"] {
    flex-grow: 1;
}

/* --- GALLERY STYLES --- */
img {
  max-width: 100%;
  height: auto; /* Allow height to adjust automatically */
}

.image-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	place-items: center;
    gap: 1rem;
    width: 100%;
    /*padding: 10px 0;*/
    min-height: 90vh;
}

.grid-image {
    width: 100%;
    max-height: 400px; /* Fixed height for uniform grid items */
    object-fit: cover; /* Changed from contain to cover for better fill */
    /*box-shadow: 0px 0px 8px 0px white;
    border-radius: 5px;*/
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/*
.grid-image:hover {
    transform: scale(1.05);
    box-shadow: 0px 0px 15px 3px white;
}
*/

/* --- SIMPLE PAGE VIEWER --- */
.simple-view-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.main-image-container {
    max-width: 100%;
}

.main-image {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    object-fit: contain;
    /*box-shadow: 0px 0px 8px 0px white;
    border-radius: 5px;*/
}

.thumbnail-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.thumbnail-image {
    height: 80px;
    width: auto;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0px 0px 5px 0px #555;
    transition: box-shadow 0.2s ease;
}

.thumbnail-image.active {
    box-shadow: 0px 0px 10px 2px white;
}

/* --- ANIMATIONS --- */
.fade-in {
    animation: fade-in 0.3s ease-in-out forwards;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .content-container {
        width: 95%;
    }

    .form-container .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-label {
        text-align: left;
        margin-bottom: 0.25rem;
    }

    .actions-container {
        flex-direction: column;
        align-items: stretch;
    }

    .action-piece {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .btn-customized, .GreyButton, .GreenButton, .BlueButton {
        padding: 6px 12px;
        font-size: 13px;
    }

    .image-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .grid-image {
        max-height: 800px;
    }

    .thumbnail-image {
        height: 60px;
    }
}

.admin-logo {
    max-width: 100%;
    margin-top: 50px;
    margin-top: 20px;
}

.admin-header {
    color: #daa520;
}

.form-group {
	margin-top: 10px;
}

/* --- Download button --- */
.image-container {
    position: relative;
}

.download-button {
    position: absolute;
    top: 8px;
    right: 8px;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
    opacity: 0; /* Default to hidden for hover devices */
}

/* --- For devices that CAN hover (like a desktop with a mouse) --- */
@media (hover: hover) {
    .image-container:hover .download-button {
        opacity: 1; /* Show on hover */
    }
}

/* --- For devices that CANNOT hover (like most touch screens) --- */
@media (hover: none) {
    .download-button {
        opacity: 1; /* Always show */
    }
}