body, html {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    height: 100vh;
    overflow: hidden; /* Prevent scrollbars on body */
}

.container {
    display: flex;
    height: 100vh;
}

.sidebar-left {
    width: 200px;
    background-color: #f0f0f0;
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid #ccc;
}

.sidebar-left p {
    text-align: center;
    color: #555;
}

.main-content {
    flex-grow: 1;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevent scrollbars */
    background-color: #e9e9e9;
}

#image-display-area {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#caliperImg {
    object-fit: contain; /* Ensure image aspect ratio is maintained */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* Make sure canvas from CaliperCanvas also scales properly */
#image-display-area canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

.sidebar-right {
    width: 80px;
    background-color: #f0f0f0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 1px solid #ccc;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.control-icon {
    font-size: 2em; /* Make icons larger */
    color: #555;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    border: none; /* Remove black border around icons */
    transition: background-color 0.3s, color 0.3s;
}

.control-icon:hover {
    background-color: #ddd;
    color: #333;
}

.thumbnail-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.thumbnail-list li img {
    width: 100%;
    max-width: 150px; /* Adjust as needed */
    height: auto;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail-list li img:hover,
.thumbnail-list li img.active-thumbnail {
    border-color: #007bff;
}

.thumbnail-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.thumbnail-filename {
    display: block;
    max-width: 150px;
    font-size: 11px;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #333;
}

.thumbnail-filename.hidden {
    display: none;
}

#toggle-filenames-button.active {
    background-color: #007bff;
    color: white;
}

#toggle-filenames-button:not(.active) {
    opacity: 0.6;
}