/* --- General Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
}

/* Add padding for the sticky header only on the gallery page */
body:not(.login-page):not(.menu-page) {
    padding-top: 72px;
}

main {
    padding: 20px;
}

/* --- Banner Styles --- */
.banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* Make the banner sticky ONLY on the gallery page */
body:not(.login-page):not(.menu-page) .banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.logo {
    height: 48px;
    margin-right: 15px;
}
.banner h1 {
    font-size: 1.2em;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}
.menu-button {
    text-decoration: none;
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    white-space: nowrap;
}
.logout {
    background-color: #dc3545;
}

/* --- Login Page Styles --- */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 50px;
    gap: 15px;
}
.login-container input {
    padding: 10px;
    font-size: 16px;
    width: 250px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.login-container button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
}

/* --- Menu Page Styles --- */
.menu-container {
    max-width: 800px;
    margin: 0px auto;
}
.menu-container ul {
    list-style: none;
    padding: 0;
}
.menu-container li a {
    display: block;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    text-decoration: none;
    color: #007bff;
    font-size: 1.2em;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.menu-container li a:hover {
    background-color: #f7f7f7;
}

/* --- Jump to Photo Styles --- */
.jump-container {
    padding: 10px 15px;
    background-color: #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}
.jump-container label {
    font-weight: bold;
}
.jump-container input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px; 
}
.jump-container button {
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #6c757d;
    color: white;
    border-radius: 5px;
}

/* --- Wrapping Gallery Grid --- */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px;
    padding: 10px;
}
@media (min-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    }
}
.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 100%; 
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}
.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.filename-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    font-size: 12px;
    padding: 10px 5px 5px;
    box-sizing: border-box;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0,0,0,0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.modal-nav.prev {
    left: 15px;
}
.modal-nav.next {
    right: 15px;
}
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
.modal-filename {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 16px;
}
.modal .jump-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.5);
    padding: 5px;
    border-radius: 5px;
}
.modal .jump-container input, .modal .jump-container button {
    background-color: #333;
    color: white;
    border-color: #555;
}
.modal .jump-container label {
    display: none;
}

/* --- Month Navigation Styles --- */
.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #e9ecef;
    margin-bottom: 20px;
    border-radius: 5px;
}
.month-nav a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}
.month-nav .current-month {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}
