body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f3f3f3;
}

main {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;

}

#controls-window {
    margin: 1rem;
    width: 300px;
    height: fit-content;
}

#controls-window .window-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Add spacing between control groups */
}

#info-panel,
#more-panel {
    padding: 0.5rem;
}

#more-window .window-body {
    overflow: auto; /* Allows content to scroll when window is smaller than content */
    max-height: 700px;
}
#more-window {
    display: none;
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    min-width: 250px; 
    min-height: 150px;
    height: max-content;
    transform: translate(-50%, -50%); /* Corrected to center properly */
}

#more-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    min-width: 480px; /* Minimum width for the content before it gets clipped */
    min-height: 300px;
}

#more-panel .write-up {
    grid-column: 2 / span 2; /* Span all 5 columns */
    white-space: pre-wrap; /* Respects line breaks in the HTML */
    margin-bottom: 10px;
    font-size: 1.5em;
    font-weight: 500; 
}
#empty {
     grid-column: 4 / span 1;
}
#more-panel .grid-image {
    justify-self: center; /* Center horizontally */
    align-self: center;   /* Center vertically */
    max-width: 100%;      /* Prevent image from overflowing cell */
    height: 400px;
    object-fit: cover;
}

button {
    cursor: pointer;
}
.field-row-stacked > input {
    cursor: grab;
}
.field-row-stacked > input:active {
    cursor: grabbing;
}

#preview {
    flex: 2;
    background-color: rgb(211, 211, 211);
    font-family: 'Times New Roman';
    > #sticker {
        position: relative;
        width: 290px;
        height: 900px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: rgb(238, 238, 238);
        border: 1px none red;
        > #sticker-canvas {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            background: rgba(0, 0, 0, 0.0);
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: minmax(0, 1fr) repeat(30, minmax(0, 1fr));
            overflow: clip;
            > img {
                filter: grayscale(100%);
            }
            > .term {
            border: 1px none red;
            color: white;
            font-size: 1.1em;
            grid-column: 2 / span 1;
            grid-row: 3 / span 1; /* grid is 3 by 30, input 1 to 31*/
            mix-blend-mode: difference;
            }
            > .multi-term {
                border: 1px none red;
                color: white;
                font-size: 0.86em;
                grid-column: 2 / span 30;
                grid-row: 3 / span 1; /* grid is 3 by 30, input 1 to 31*/
                mix-blend-mode: difference;
            }
            > .big-term {
                border: 1px none red;
                color: white;
                font-size: 3.1em;
                grid-column: 2 / span 1;
                grid-row: 3 / span 1; /* grid is 3 by 30, input 1 to 31*/
                mix-blend-mode: difference;
            }
            > .sentence
            {
                grid-column: 2 / span 9;
            }
        }
    }   
}

@media print {
  body {
    visibility: hidden;
  }
  #sticker {
    visibility: visible;
    position: absolute;
    left: 0;
    top: 0;
  }
}
