#array_format_modal {
    /* Layout */
    .container

{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Panel Styles */
.panel {
    background-color: #ddd2ff;
    padding: 10px;
    border: 1px solid #ccc;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

    .input-group label {
        width: 80px;
        margin-right: 5px;
    }

    .input-group input,
    .input-group select {
        width: 70px;
        height: 25px;
    }

/* Preview Area */
.preview-area {
    position: relative;
    background-color: black;
    grid-column: 1 / span 3;
    height: 73vh;
    width: 50vw;
}

    .preview-area canvas {
        width: 100%;
        height: 100%;
        background-color: black;
        border: 1px solid #333;
    }

/* Corner Boxes */
.corner-boxes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner-box {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 3px;
    color: white;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    pointer-events: all;
    user-select: none;
}

    .corner-box:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .corner-box input {
        margin: 0;
        width: 14px;
        height: 14px;
    }

    .corner-box.top-left {
        top: 8px;
        left: 8px;
    }

    .corner-box.top-right {
        top: 8px;
        right: 8px;
    }

    .corner-box.bottom-left {
        bottom: 8px;
        left: 8px;
    }

    .corner-box.bottom-right {
        bottom: 8px;
        right: 8px;
    }

/* Fiducial Panel */
.fiducial-header {
    background: #e6e6ff;
    padding: 5px 10px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.fiducial-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
}

.fiducial-inputs {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 3px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

    .input-row label {
        min-width: 60px;
    }

    .input-row input,
    .input-row select {
        width: 80px;
        height: 25px;
        border: 1px solid #ccc;
    }

/* Fiducial List */
.fiducial-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Buttons */
.button-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding: 0 10px;
}

.btn-add,
.btn-remove {
    padding: 5px 15px;
    border: none;
    cursor: pointer;
    background-color: #ff99ff;
}

.btn-remove {
    width: 100%;
}

/* Side Options */
.side-options {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.side-group {
    position: absolute;
    display: flex;
    gap: 10px;
    pointer-events: all;
}

.option-box {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 3px 6px;
    color: white;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

    .option-box:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .option-box input {
        margin: 0;
    }

/* Position the groups */
.side-group.top {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.side-group.right {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    flex-direction: column;
}

.side-group.bottom {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.side-group.left {
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    flex-direction: column;
}


#fiducialList option:hover {
    background-color: #f0f0f0;
}

.fiducial-list {
    flex-grow: 0; /* Changed from 1 to prevent growing */
    margin: 0;
    padding: 0;
    height: 80px; /* Reduced fixed height */
}

#fiducialList {
    width: 100%;
    height: 100%;
    background: white;
    border: 1px solid #ccc;
    font-size: 11px; /* Slightly smaller font */
}

    #fiducialList option {
        padding: 2px 6px; /* Reduced padding */
        line-height: 1.2; /* Tighter line height */
    }


.border-group {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.border-select {
    width: 60px;
    height: 22px;
    font-size: 12px;
}

/* Position the border groups */
.border-group.top {
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.border-group.right {
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    flex-direction: column;
}

.border-group.bottom {
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.border-group.left {
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    flex-direction: column;
}


/* Adjust existing side-group positions to avoid overlap */
.side-group.top {
    top: 80px;
}

.side-group.right {
    right: 150px;
}

.side-group.bottom {
    bottom: 80px;
}

.side-group.left {
    left: 150px;
}


.tooling-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 10px;
}

.tooling-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px;
}

.tool-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-list {
    flex-grow: 0;
    margin: 0;
    padding: 0;
    height: 80px;
}

#toolList {
    width: 100%;
    height: 100%;
    background: white;
    border: 1px solid #ccc;
    font-size: 11px;
}

    #toolList option {
        padding: 2px 6px;
        line-height: 1.2;
    }

.tooling-inputs .input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

    .tooling-inputs .input-row label {
        min-width: 60px;
    }

    .tooling-inputs .input-row input {
        width: 80px;
        height: 25px;
        border: 1px solid #ccc;
    }

#removeTool {
    width: 100%;
    padding: 5px 15px;
    border: none;
    cursor: pointer;
    background-color: #ff99ff;
}

.btn-add {
    padding: 5px 15px;
    border: none;
    cursor: pointer;
    background-color: #ff99ff;
    height: 25px;
    font-size: 12px;
}
}
