body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6; /* Light gray background */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}
.container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 24px;
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.controls, .image-navigation, .rename-section {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px;
    align-items: center;
    justify-content: center;
}
.controls button, .image-navigation button, .rename-section button {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.controls input, .rename-section input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    flex-grow: 1; /* Allow input to grow */
    min-width: 150px; /* Minimum width for inputs */
}
.main-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background-color: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}
.main-image img {
    max-width: 100%;
    max-height: 500px; /* Limit height for large images */
    object-fit: contain;
    border-radius: 8px;
}
.thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    min-height: 120px;
    max-height: 250px; /* Max height for scrollable thumbnails */
    overflow-y: auto; /* Enable vertical scrolling */
    background-color: #f9fafb;
}
.thumbnail-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    position: relative;
    background-color: #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px; /* Fixed height for thumbnails */
}
.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the thumbnail area */
    border-radius: 6px;
}
.thumbnail-item.selected {
    border-color: #2563eb; /* Blue border for selected thumbnail */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}
.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.file-info {
    text-align: center;
    font-size: 1.1rem;
    color: #4b5563;
    margin-top: 10px;
}
.message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 25px 35px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
    display: none; /* Hidden by default */
    border: 1px solid #ccc;
}
.message-box button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}
.message-box.show {
    display: block;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}
.overlay.show {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .controls, .image-navigation, .rename-section {
        flex-direction: column;
        align-items: stretch;
    }
    .controls button, .image-navigation button, .rename-section button,
    .controls input, .rename-section input {
        width: 100%;
    }
}
