﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: flex-end;
}

    .top-row .title {
        font-weight: bold;
        color: #f9f65d
    }

.top-menu {
    height: 3.5rem;
    text-align: right;
    position: sticky;
    top: 0;
    border-bottom: 1px solid #d6d5d5;
    background-color: #f7f7f7;
    justify-content: flex-end;
    padding-top: 30px;
}

    .top-menu a {
        margin-left: 0.5rem;
    }

.main {
    flex: 1;
}

    .main .top-row {
        background-color: #f7f7f7;
        border-bottom: 1px solid #d6d5d5;
        justify-content: flex-end;
    }

        .main .top-row > a, .main .top-row .btn-link {
            white-space: nowrap;
            margin-left: 1.5rem;
        }

        .main .top-row a:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

    .sidebar .top-row {
        background-color: rgba(0,0,0,0.4);
    }

    .sidebar .navbar-brand {
        font-size: 1.1rem;
    }

    .sidebar .oi {
        width: 2rem;
        font-size: 1.1rem;
        vertical-align: text-top;
        top: -2px;
    }

    .sidebar .nav-item {
        font-size: 0.9rem;
        padding-bottom: 0.5rem;
    }

        .sidebar .nav-item:first-of-type {
            padding-top: 1rem;
        }

        .sidebar .nav-item:last-of-type {
            padding-bottom: 1rem;
        }

        .sidebar .nav-item a {
            color: #d7d7d7;
            border-radius: 4px;
            height: 3rem;
            display: flex;
            align-items: center;
            line-height: 3rem;
        }

            .sidebar .nav-item a.active {
                background-color: rgba(255,255,255,0.25);
                color: white;
            }

            .sidebar .nav-item a:hover {
                background-color: rgba(255,255,255,0.1);
                color: white;
            }

.title {
    position: relative;
}

    .title img {
        width: 30px;
        height: 30px;
    }

    .title span {
        display: inline-block;
        height: 24px;
        position: absolute;
        bottom: 5px;
        padding-left: 5px;
    }

.page-title {
    font-weight: bold;
    margin-right: 15px;
}

@media only screen and (max-width: 900px) {
    .page-name {
        display: none;
    }
}

@media only screen and (max-width: 900px) {
    .welcome {
        display: none;
    }
}

.content {
    padding-top: 1.1rem;
}

@media only screen and (max-width: 900px) {
    .content br {
        display: none;
    }
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.footer {
    position: absolute;
    left: 30px;
    bottom: 30px;
}

    .footer a {
        text-decoration: none;
    }

        .footer a.artsoft-link {
            color: #3081d3;
            font-size: 0.9em;
        }

        .footer a.regulations-link {
            font-size: 0.8em;
        }

@media screen and (max-width: 800px) {
    .footer {
        display: none;
    }
}

@media screen and (min-width: 800px) {
    h6.header {
        padding-left: 60px;
    }
}

.index-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #fc6c42;
}

.index-description {
    max-width: 90%;
}

table.search td {
    margin: 2px;
}

    table.search td.label {
        text-align: right;
        width: 60px;
    }

    table.search td.field {
    }

    table.search td.buttons {
    }

div.empty-list {
    padding-left: 60px;
}

div.list-links {
    padding-left: 60px;
}

form.form {
}

    form.form div {
    }

        form.form div label.label {
            text-align: right;
            margin-right: 5px;
        }

        form.form div label.label-2 {
            text-align: right;
            margin-right: 5px;
        }

@media screen and (min-width: 1000px) {
    form.form div label.label {
        width: 100px;
    }
}

@media screen and (min-width: 1000px) {
    form.form div label.label-2 {
        width: 100px;
    }
}

form.form div label.description-label {
    vertical-align: top;
}

form.form div span.description-field {
    display: inline-block;
    width: 80%;
}

input[type=text] {
    height: 25px;
    max-width: 500px;
    width: 100%;
}

input.checkbox {
    width: 18px !important;
    height: 18px !important;
    transform: translateY(3px) !important;
}

input.form-input-select {
    width: 400px;
}

input.valid {
    height: 25px;
    max-width: 500px;
    width: 100%;
}

input.invalid {
    height: 25px;
    max-width: 500px;
    width: 100%;
}

input[type=password] {
    height: 25px;
    max-width: 500px;
    width: 100%;
}

textarea {
    height: 100px;
    max-width: 500px;
    width: 100%;
}

button.button {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
    margin-left: 2px;
    padding: 0px;
    padding-left: 7px;
    padding-right: 7px;
    height: 25px;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

@media screen and (min-width: 800px) {
    div.save {
        padding-left: 106px;
    }
}

@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, .main .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }

    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }
}

.input-text,
.short-input-text {
    width: 100%;
}

.input-text {
    max-width: 300px;
}

.short-input-text {
    max-width: 150px;
}

.no-wrap {
    white-space: nowrap;
}

@media screen and (min-width: 1000px) {
    div .created-updated {
        padding-left: 100px;
    }
}

@media screen and (min-width: 800px) {
    div.form-links {
        padding-left: 100px;
    }
}

div.board {
    width: 100%;
    display: flex;
    justify-content: center;
    /*text-align: center;*/
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    /*border: 1px solid red;*/
    /*align-items: center;*/
}

    div.board div.board-container {
        position: relative;
        grid-area: chess;
    }

    div.board div.player-container {
        text-align: center;
        width: 100%;
        max-width: 200px;
        /*border: 1px solid red;*/
    }

.board-player {
    margin-top: 50px;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #d0cece;
}

    .board-player.active {
        border: 2px solid #1ea046;
    }

    .board-player .board-player .player-name {
        font-size: 1.1em;
        font-weight: bold;
    }

    .board-player .board-player .player-color {
        font-size: 1.1em;
        font-weight: bold;
    }

    .board-player .player-pieces .piece {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        margin-right: 6px;
    }

    .board-player .player-pieces .piece-symbol {
        line-height: 1;
    }

    .board-player .player-pieces .piece-count {
        font-size: 0.75em;
        line-height: 1;
    }

    .board-player .player-status .turn {
        color: #0a772c;
    }

    .board-player .player-status .waiting {
        color: gray;
    }

    .board-player .check {
        color: red;
        font-weight: bold;
    }

    .board-player .player-pieces .material-sum {
        font-weight: bold;
    }

/*@media (max-width: 1400px) {
    div.board div.player-container {
        display: none;
    }
}
*/
div.board table.chessboard {
    /*min-width: 560px;*/
    border-collapse: collapse;
    table-layout: fixed;
    position: relative;
}

    div.board table.chessboard td.top-left-corner {
        border-top: 2px solid gray;
        border-left: 2px solid gray;
    }

    div.board table.chessboard td.top-right-corner {
        border-top: 2px solid gray;
        border-right: 2px solid gray;
    }

    div.board table.chessboard td.bottom-left-corner {
        border-left: 2px solid gray;
        border-bottom: 2px solid gray;
    }

    div.board table.chessboard td.bottom-right-corner {
        border-right: 2px solid gray;
        border-bottom: 2px solid gray;
    }

    div.board table.chessboard td.letter {
        height: 15px;
        text-align: center;
        font-size: 10px;
        line-height: 10px;
    }

    div.board table.chessboard td.top-letter {
        border-top: 2px solid gray;
    }

    div.board table.chessboard td.bottom-letter {
        border-bottom: 2px solid gray;
    }

    div.board table.chessboard td.number {
        font-size: 10px;
        vertical-align: middle;
        text-align: center;
        width: 15px;
    }

    div.board table.chessboard td.left-number {
        border-left: 2px solid gray;
    }

    div.board table.chessboard td.right-number {
        border-right: 2px solid gray;
    }

    div.board table.chessboard td.field {
        width: 50px;
        height: 50px;
        border: 2px solid gray;
        box-sizing: border-box;
        text-align: center;
        vertical-align: middle;
        font-family: "Segoe UI Symbol", "Arial Unicode MS", "Noto Sans Symbols", monospace;
        font-size: 0px;
        text-align: center;
        vertical-align: middle;
        line-height: 0;
        padding: 0;
        margin: 0;
        pointer-events: auto;
        overflow: hidden;
    }

@media only screen and (max-width: 900px) {
    div.board table.chessboard td.field {
        width: 40px;
        height: 40px;
        font-size: 26px;
    }
}

@media only screen and (min-width: 900px) {
    div.board table.chessboard td.field {
        width: 50px;
        height: 50px;
        font-size: 35px;
    }
}

div.board table.chessboard td.black {
    background: #d7bebe
}

div.board table.chessboard td.valid-move {
    background-color: rgba(76, 175, 80, 0.3);
}

div.board table.chessboard td.invalid-move {
    background-color: rgba(244, 67, 54, 0.3);
}

div.board table.chessboard td.field span.piece {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    font-size: 35px;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    touch-action: none;
    z-index: 1;
    background-color: transparent;
}

@media only screen and (max-width: 900px) {
    div.board table.chessboard td.field span.piece {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 26px;
    }
}

@media only screen and (min-width: 900px) {
    div.board table.chessboard td.field span.piece {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 35px;
    }
}

.piece.dragging {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
}

div.board table.chessboard td.field span.piece:active {
    cursor: grabbing;
}

.buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    flex-wrap: wrap;
}

div.buttons a.link {
    cursor: pointer;
    text-decoration: none;
    color: #0366d6;
    user-select: none;
}

    div.buttons a.link:hover {
        text-decoration: underline;
    }

.moves {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    column-gap: 10px;
    row-gap: 0px;
    margin-top: 10px;
}

    .moves > div {
        white-space: nowrap;
    }

        .moves > div span.current {
            color: red;
            font-weight: bold;
        }

    .moves > span.last-ai-move {
        color: lightgray;
    }

.check-container {
    text-align: center;
}

.checkmate-overlay,
.check-overlay,
.stalemate-overlay {
    display: inline-block;
    margin: 0 auto;
    padding: 4px 8px;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    text-align: center;
}

.checkmate-overlay {
    background-color: red;
}

.check-overlay {
    background-color: #dab85a;
}

.stalemate-overlay {
    background-color: #d4c432;
}

.promotion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.promotion-dialog {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

    .promotion-dialog button {
        font-size: 35px;
        margin: 10px;
        width: 50px;
        height: 50px;
        cursor: pointer;
    }

@media only screen and (max-width: 900px) {
    .promotion-dialog button {
        font-size: 26px;
        margin: 5px;
        width: 40px;
        height: 40px;
    }
}

@media only screen and (min-width: 900px) {
    .promotion-dialog button {
        font-size: 35px;
        margin: 10px;
        width: 50px;
        height: 50px;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-window {
    background: white;
    padding: 20px;
    border-radius: 6px;
    min-width: 300px;
}

.popup-buttons {
    text-align: center;
    padding-top: 10px;
}

/*.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
*/

.board-loading-overlay {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 400px;
    height: 400px;
    background-color: rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

@media only screen and (max-width: 900px) {
    .board-loading-overlay {
        width: 352px;
        height: 352px;
    }
}

@media only screen and (min-width: 900px) {
    .board-loading-overlay {
        width: 430px;
        height: 430px;
    }
}

.board-loading-overlay img {
    width: 80px;
    height: 80px;
}

ul.regulations {
    font-size: 0.9em;
}

.cookie-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    z-index: 1000;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    line-height: 1;
}

    .cookie-check span {
        line-height: 1;
        display: inline-block;
    }

.small-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: middle;
}

#debug_div {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: black;
    color: lime;
    font-family: monospace;
    font-size: 12px;
    padding: 5px;
    z-index: 9999;
    opacity: 0.9;
    border: 1px solid red;
}
