/* copyright 2025 Unlost GmbH. All rights reserved. */

#precanvas,
#postcanvas {
    background-color: white;
    display: flex;
    flex-direction: column;
    border: 2px solid #000;
    /* Solid black border */
    padding: 2px;
    /* Adds space inside the div */
    margin-top: -2px;
    margin-bottom: -2px;
}

#precanvas>h2 {
    margin-top: 0px;
    margin-bottom: 4px;
    font-size: 16px;
    text-align: center;
}

[contenteditable="true"]:focus {
    text-transform: none;
    color: #33d;
} 

#precanvas>p {
    margin-top: 0px;
    font-size: 1rem;
    text-align: center;
}

#canvas,
div.cell {
    border: 1px solid;
    background: #fff;
}

#canvas {
    display: grid;
    overflow: auto;
    font-size: 11px;
    gap: 0px;
}

/* layout types: generic cell names, max 14 */

#canvas > div:nth-child(1) { grid-area: a; }
#canvas > div:nth-child(2) { grid-area: b; }
#canvas > div:nth-child(3) { grid-area: c; }
#canvas > div:nth-child(4) { grid-area: d; }
#canvas > div:nth-child(5) { grid-area: e; }
#canvas > div:nth-child(6) { grid-area: f; }
#canvas > div:nth-child(7) { grid-area: g; }
#canvas > div:nth-child(8) { grid-area: h; }
#canvas > div:nth-child(9) { grid-area: i; }
#canvas > div:nth-child(10) { grid-area: j; }
#canvas > div:nth-child(11) { grid-area: k; }
#canvas > div:nth-child(12) { grid-area: l; }
#canvas > div:nth-child(13) { grid-area: m; }
#canvas > div:nth-child(14) { grid-area: n; }

div.cell {
    padding: 4px;
    display: flex;
    flex-direction: column;
}

div.cell h3,
#postcanvas h3 {
    margin-top: 0px;
    margin-bottom: 8px;
    font-size: 12px;
}

div.cell>h4,
div.cell>h5,
#postcanvas>h4 {
    margin-top: 0px;
    margin-bottom: 0px;
    text-align: center;
    color: #00d;
    font-size: 12px;
}

div.cell>h5 {
    font-weight: 400;
}

.scoring-dropdown,
.score-total {
    text-align: center;
    position: relative;
    width: 10px;
    height: 1.5em;
    top: 0;
    right: 0;
    padding: 1px;
    font-size: 11px;
    appearance: none;
    color: #000;
    background-color: #ddf;
    border: 1px solid black;
}

span.score-total {
    display: flex;
    flex: 1;
    flex-grow: 0;
    width: 20px;
    height: 1.2em;
    text-align: center;
    align-items: center;
    border: 1px #aaa solid;
    margin-top: 0px;
    /* margin-bottom: 10px; */
    font-size: 12px;
}

h3.score-total-label {
    flex: 1;
    margin-right: 5px;
    text-align: right;
}

.cell-title-container {
    position: relative;
    display: flex;
    justify-content: space-between;
}

.cell-card-container {
    padding-bottom: 20px;
    user-select: none;
    /* Chrome/Safari, Firefox, IE8+ */
    /* -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; */
    flex-grow: 1;
    overflow: auto;
}

.hover-help {
    display: none;
    position: absolute;
    text-transform: none;
    z-index: 1;
    /* margin-top: 10px; */
    width: 100%;
    color: #33d;
    background-color: rgba(255, 255, 255, .8);
}

/* simplify mobile "hover" */
.cell-title {
    user-select: none;
    -webkit-user-select: none;
}

div.cell>p,
#postcanvas>p {
    margin-top: 0px;
    font-size: 12px;
}

.card {
    padding: 5px;
    cursor: text;
    margin: 5px;
    background: #ffd;
    color: #000;
    font-size: 1.2em;
    display: flex;
    align-items: left;
    justify-content: left;
    box-shadow: 0 2px 6px 1px rgba(0, 0, 0, .2);
    max-width: 350px;
    min-width: 100px;
    min-height: 10px;
    flex-grow: 1;
    flex-shrink: 1;
}

.card.comment { background-color: #eee; }
.card.query { background-color: #dff; }
.card.analysis { background-color: #fdd; }
.card.emphasis { background-color: #fcc; }

.card.highlight, .cell-card-container.highlight { border: dashed black 1px; }

.card.dragging { cursor: grabbing; }

.clicked, .menuopen {
    background-color: #ccc;
    white-space: pre-wrap;
}

.helpcard {
    background-color: #ddd;
}

p.hint, p.intro {
    font-size: 0.8em;
    display: none;
}

p.hint2 {
    font-size: 1em;
}

div.signature { 
    display: flex;
    justify-content: space-between;
}

div.canvastype, div.canvassource { 
    font-size: 0.5em;
    margin-top: 2px;
    text-transform: uppercase;
}

div.canvassource {
    text-align: right;
}

#controls {
    display: flex;
    flex-direction: row;
    font-size: 0.8em;
}

.block2 {
    margin-bottom: 30px;
}

.control {
    flex: 1 1 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    font-size: 0.8em;
    text-align: center;
    min-width: 90px;
    margin: 2px;
    cursor: pointer;
    background-color: #f3f3f3;
}

.overlay-menu {
    /* display: none; */
    position: absolute;
    min-width: 300px;
    min-height: 50px;
    padding: 5px;
    border: 1px solid black;
    background-color: #eee;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100;
    overflow: auto;
}

.overlay-menu > h3 {
    font-size: 10pt;
    margin-top: 0px;
}

.overlay-menu-item {
    position: relative;
    padding: 5px;
    font-size: 0.8em;
    cursor: pointer;
    border-bottom: 1px solid #ddd; /* Optional: for styling */
}

.overlay-menu-item:hover {
    background-color: #f1f1f1;
}

.overlay-menu-item-delete {
    position: absolute;
    right: 10px;
    text-align: center;
    width: 50px;
    font-size: 8pt;
    border: 1px solid black;
}

/* mobile screens */
@media screen and (max-width: 768px) {
    #canvas {
        display: grid;
        grid-auto-columns: min-content;
        overflow: auto;
        font-size: 10px;
        gap: 0px;
    }

    #canvas>div {
        padding: 2px;
    }

    #canvas>div>h3 {
        margin-top: 0px;
        margin-bottom: 10px;
        font-size: 10px;
    }

    #canvas>div>h4,
    #canvas>div>h5 {
        margin-top: 0px;
        margin-bottom: 0px;
        text-align: center;
        color: #00d;
        font-size: 10px;
    }

    #canvas>div>h5 {
        font-weight: 400;
    }

    #canvas>div>p {
        font-size: 10px;
        line-height: 1.2;
        color: #888;
        font-style: italic;
        text-align: center;
    }

    #controls {
        flex-wrap: wrap;
    }

    .control {
        min-width: 20%;
    }
    
}