/* Basic setup for fullscreen canvas */
body {
    background-color: #008080; /* Classic Windows Teal */
    height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Pixelated MS Sans Serif", Arial;
    overflow: hidden; /* Prevent scrolling on desktop */
}

/* 
   RETRO BORDERS:
   Standard 98.css handles the outer window. 
   These utilities handle the internal sunken fields.
*/
.sunken-panel {
    border: none;
    box-shadow: inset -1px -1px #ffffff, 
                inset 1px 1px #0a0a0a, 
                inset -2px -2px #dfdfdf, 
                inset 2px 2px #808080;
    background-color: #ffffff;
}

/* Main window sizing */
.main-window {
    width: 800px;
    max-width: 95vw;
    height: 600px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.title-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: bottom;
}

.window-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column; /* Changed to allow stacking about content */
    padding: 12px;
    background-color: #c0c0c0;
    position: relative;
    transition: background-color 0.2s;
}

/* Drag over visual cue */
.window-body.drag-over {
    background-color: #d8d8d8;
    /* We don't use dashed border here to keep pixel perfection of the layout */
}

.split-view {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 12px;
}

.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.output-section {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Frame around the QR area, sunken look done via CSS now, not border */
}

.instruction-text {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #000;
}

.retro-input {
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
    resize: none;
    padding: 8px;
    font-family: "Courier New", monospace;
    font-size: 15px;
    outline: none;
    margin-bottom: 8px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;
}

.char-count {
    color: #555;
    font-size: 11px;
}

/* QR Code styling */
.qr-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 280px;
    height: 280px;
    margin-bottom: 15px;
    background: #fff;
}

#qrcode img {
    image-rendering: pixelated; 
    display: block;
}

.qr-placeholder span {
    color: #888;
    font-style: italic;
}

.status-message {
    font-weight: bold;
    color: #000;
    text-align: center;
    margin: 0;
}

/* About Popup Styling */
.about-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    z-index: 999;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.5);
}

.about-content {
    display: flex;
    align-items: center;
    padding: 10px;
}

/* 
   RESPONSIVE: SEAMLESS FULLSCREEN
   When on mobile/small screens, the window becomes the screen.
*/
@media (max-width: 768px) {
    body {
        background-color: #c0c0c0; /* Match window bg to hide overscroll */
        align-items: flex-start; /* Align top */
    }

    .main-window {
        width: 100vw;
        height: 100vh; /* Use 100vh for fallback */
        height: 100dvh; /* Dynamic viewport height for modern mobile browsers */
        max-width: none;
        max-height: none;
        margin: 0;
        box-shadow: none; /* Remove drop shadow */
        border: none; /* Remove default 98.css borders? */
    }
    
    /* 
       If you want to keep the bevels on mobile, remove 'border: none'. 
       If you want it truly seamless (flat edge), keep 'border: none'.
       98.css adds borders via box-shadow on .window, so we reset that:
    */
    .main-window {
        box-shadow: none !important;
    }

    .split-view {
        flex-direction: column;
        gap: 20px;
    }
    
    .output-section {
        flex: 1;
        min-height: 300px;
        order: -1; /* Move QR to top on mobile for easy scanning? Or keep bottom? Let's keep bottom standard. */
        order: 1; 
    }
}