﻿:root {
    --cell-size: 50px;
    --hint-size: 50px;
}

.cell,
.lineHint,
.candidateCount,
.gridSpacer {
    box-sizing: border-box;
}

.cell {
    width: 50px;
    height: 50px;
}

html,
body
{
    font-family: Segoe UI;
    height: 100%;
    margin: 0px;
    overflow: hidden;
    background-color: blanchedalmond;
}

body {
    display: flex;
    flex-direction: column;
}


#toolbar {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: auto auto auto 1fr;
    column-gap: 30px;
    align-items: stretch;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid #b0b0b0;
    border-radius: 6px;
    background: #f6f6f688;
    margin: 20px;
}

.toolbarGroup {
    display: flex;
    flex-direction: column;
}

.toolbarButton {
    justify-content: stretch;
}

    .toolbarButton button {
        flex: 1;
        min-width: 140px;
    }

.toolbarOptions {
    display: flex;
    width: fit-content;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.optionRow {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 12px;
}


#notificationArea {
    position: fixed;
    flex: 0 0 auto;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

    #notificationArea.visible {
        opacity: 1;
        transform: translateY(0);
    }


#puzzleArea {
    display: grid;
    grid-template-columns: repeat(6, var(--cell-size));
    grid-template-rows: repeat(6, var(--cell-size));
    gap: 2px;
    margin: 20px;
}

.corner,
.colHint,
.rowHint,
.candidateCount {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cell-size);
    height: var(--cell-size);
}

.corner {
    cursor: default;
}

.colHint {
    cursor: pointer;
    flex-direction: column;
    font-weight: bold;
}

.rowHint {
    cursor: pointer;
    display: flex;
    font-weight: bold;
    /*background: #ffffff88;*/
}

.selectedHint {
    outline: 2px solid orange;
}

.candidateCount {
    cursor: pointer;
    display: flex;
    color: gray;
}

.candidateCount.hidden {
    visibility: hidden;
    cursor: default;
    pointer-events: none;
}

.puzzlePiece {
    width: var(--cell-size);
    height: var(--cell-size);
    background: #d8d8d8;
    border: 1px solid #888;
    box-sizing: border-box;
}

    .puzzlePiece.white {
        background: white;
    }

    .puzzlePiece.black {
        background: black;
    }


#mainContainer {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: 30px;
    min-height: 0;
    overflow: hidden;
}

#puzzleBody {
    display: flex;
    align-items: center;
}


#gridSpacer {
    width: 50px;
    height: 50px;
}


#sidePanel {
    flex: 1 1 300px;
    box-sizing: border-box;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    min-width: 300px;
    max-width: 100%;
    max-height: 100%;
}

#candidateExplorer {
    margin-left: 20px;
}


.candidateItem {
    font-family: monospace;
    margin: 4px;
}

.lineHint {
    cursor: pointer;
}

    .lineHint.selected {
        background: #d8e8ff;
        border-radius: 0px;
    }



.candidate {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.candidateCell {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border: 1px solid #888;
    box-sizing: border-box;
    flex: 0 0 16px;
}

    .candidateCell.zero {
        background: white;
    }

    .candidateCell.one {
        background: black;
    }

#brushPalette {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid gray;
}

.brushButton {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    cursor: pointer;
    box-sizing: border-box;
}


.whiteBrush {
    background-color: white;
}


.blackBrush {
    background-color: black;
}


.brushButton.selected {
    border-color: orangered;
}


.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 22px;
    transition: .2s;
}

    .slider::before {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        left: 2px;
        top: 2px;
        background-color: white;
        border-radius: 50%;
        transition: .2s;
    }

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.switch input:checked + .slider {
    background-color: #43A047;
}


/* solved styles */
.candidateCount.solved {
    font-size: 1.2em;
    color: green;
}

.puzzlePiece.solved {
    animation: solvedPulse 0.8s ease;
}


@keyframes solvedPulse {

    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.infoButton {
    width: 28px;
    height: 28px;
    border-radius: 10%;
    background: #1976d2;
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    justify-self: flex-end;
}


    .infoButton:hover {
        filter: brightness(1.1);
    }

.printButton {
    width: 120px;
    height: 28px;
    border-radius: 10%;
    background: lightgray;
    color: black;
    border: 1px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    justify-self: flex-end;
}


    .printButton:hover {
        filter: brightness(1.1);
    }

/* Rules html styles */
.rulesPanel {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

    .rulesPanel p,
    .rulesPanel li {
        overflow-wrap: anywhere;
    }

.ruleSection {
    margin-bottom: 20px;
}

.exampleRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 10px 0;
}

.whiteCell,
.blackCell {
    width: 24px;
    height: 24px;
    border: 1px solid #888;
}

.whiteCell {
    background: white;
}

.blackCell {
    background: black;
}

.whiteCell.selected {
    border-color: orangered;
}

.allowed {
    margin-left: 12px;
}

.notAllowed {
    margin-left: 12px;
}

.hintExample {
    margin: 12px 0;
}
