body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

#image-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.image-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 300px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    will-change: max-width;
}

.image-wrapper img {
    user-select: none;
    pointer-events: none;
    width: 100%;
    display: block;
}

.image-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
    z-index: 10;
    width: 100%;
    height: 100%;
}

.image-wrapper.expanded {
    max-width: 800px;
}

#map {
    height: 500px;
    width: 100%;
    margin-top: 20px;
}

input[type="file"] {
    margin-bottom: 10px;
}

.image-data {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.measurement-display {
    margin-top: 10px;
    width: 100%;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.measurement-display div {
    margin-bottom: 8px;
}

.measurement-display div:last-child {
    margin-bottom: 0;
}

.measurement-display label {
    display: block;
    margin-bottom: 4px;
    color: #495057;
}

.measurement-display input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

.image-controls {
    margin-bottom: 10px;
    position: relative;
    z-index: 20;
}

.edit-mode canvas {
    border: 2px solid #007bff;
}

.line-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: auto;
    overflow: hidden;
}

.line {
    position: absolute;
    height: 2px;
    cursor: move;
    background-color: rgba(255, 0, 0, 0.7);
    transform-origin: 0 50%;
    pointer-events: auto;
    will-change: transform, width;
    transition: all 0.3s ease;
}

.line-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 15;
    display: none;
}

.line-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background-color: white;
    border: 1.5px solid;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.line:hover .line-handle::after {
    opacity: 1;
}

.line-handle.dragging::after {
    opacity: 1;
}

.line:hover .line-handle:hover::after {
    transform: translate(-50%, -50%) scale(1.2);
}

.height-line .line-handle {
    border-color: #007bff;
}

.shadow-line .line-handle {
    border-color: #28a745;
}

.line-handle {
    background-color: transparent;
    border: none;
}

.line-handle.start {
    left: 0;
}

.line-handle.end {
    right: 0;
    left: 100%;
}

.image-content {
    position: relative;
    width: 100%;
    flex-grow: 1;
    margin-bottom: 10px;
}

.height-line {
    background-color: #007bff;
}

.shadow-line {
    background-color: #28a745;
}

.status-display {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    text-align: center;
    font-weight: bold;
    color: #495057;
    border: 1px solid #dee2e6;
}
