* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: #1e1e1e;
    color: #f4f4f4;
}

/* Sidebar Styles */
#gsidebar {
    width: 250px;
    background-color: #252526;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Resizer Handle */
#gsidebarresizerhandle {
    width: 6px;
    cursor: col-resize;
    background-color: #333;
    transition: background-color 0.2s;
}

#gsidebarresizerhandle:hover, #gsidebarresizerhandle:active {
    background-color: #007acc; /* Visual cue when dragging */
}

/* Main Content & Editor Layout */
#viewport {
    flex: 1;
    min-width: 0;
    display: flex;
    background-color: #1e1e1e;
    position: relative;
}

#viewport canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.editor-container {
    display: flex;
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 0;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    line-height: 1.5;
}

#line-numbers {
    width: 30px;
    flex: 0 0 30px;
    padding: 0px 0px 0px 0;
    text-align: right;
    color: #858585;
    background-color: #0f0f0f;
    user-select: none;
    overflow: hidden;
    white-space: pre;
}

#text-input {
        position: absolute;
        left: 30px;
        top: 0;
        width: calc(100% - 30px);
        height: 100%;
    border: none;
    outline: none;
    padding: 0px;
        background-color: transparent;
    color: #d4d4d4;
        caret-color: #d4d4d4;
    resize: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    overflow: auto;
    white-space: pre;
        z-index: 2;
}

.backdrop {
        position: absolute;
        left: 30px;
        top: 0;
        width: calc(100% - 30px);
        height: 100%;
        padding: 0px;
        background-color: #1e1e1e;
        color: transparent;
        font-family: inherit;
        font-size: inherit;
        line-height: inherit;
        white-space: pre;
        overflow: auto;
        z-index: 1;
        pointer-events: none;
}

.gcode-highlight {
        background-color: rgba(255, 235, 59, 0.35);
        border-radius: 2px;
}

.hover-highlight {
        background-color: rgba(0, 122, 204, 0.45);
        border-radius: 2px;
}
.tooltip {
    position: fixed; /* Keeps it relative to the viewport browser window */
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none; /* Prevents the tooltip itself from triggering mouse events */
    z-index: 1000; /* Makes sure it sits on top of other elements */
}

.editor-container.drag-over {
    background-color: rgba(0, 122, 204, 0.1);
    border: 2px dashed #007acc;
}

/* Drag overlay (for importing files) */
#drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 9999;
}

#drag-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drag-overlay-content {
    text-align: center;
    background-color: rgba(0, 122, 204, 0.2);
    border: 3px dashed #007acc;
    border-radius: 12px;
    padding: 60px 80px;
    backdrop-filter: blur(4px);
}

.drag-overlay-content p {
    font-size: 28px;
    font-weight: bold;
    color: #00d4ff;
    margin: 0 0 12px 0;
}

.drag-overlay-content small {
    font-size: 14px;
    color: #88ccff;
    display: block;
}

/* Import button when input-text is empty */
#import-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    color: #00d4ff;
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.15), rgba(0, 122, 204, 0.05));
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

#import-button:hover {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.25), rgba(0, 122, 204, 0.1));
    border-color: #007acc;
    box-shadow: 0 0 16px rgba(0, 122, 204, 0.4);
    transform: translate(-50%, -50%) scale(1.05);
}

#import-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}/* Import button when input-text is empty  end of custom tags
*/


/* phone settings */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    #gsidebar {
        width: 100%;
        height: 40vh;
        min-height: 220px;
        max-height: 45vh;
    }

    #gsidebarresizerhandle {
        display: none;
    }

    #viewport {
        min-height: 55vh;
    }

    .editor-container,
    #text-input,
    .backdrop {
        font-size: 14px;
        line-height: 1.4;
    }

    #line-numbers {
        width: 26px;
        flex-basis: 26px;
    }

    #text-input,
    .backdrop {
        left: 26px;
        width: calc(100% - 26px);
    }

}


