/* MAIN PAGE OF SUDOKU PUZZLE GAME */

body {
    background-color: #f0ffff;
}

.hidden {
    display: none;
}

.center-screen {
    align-content: center !important;
    justify-content: center !important;
    align-items: center !important;
    justify-items: center !important;
    text-align: center !important;
    margin: 0 auto !important;
}

header {
    padding-bottom: 20px;
    border-bottom: 4px solid brown;
}

h1 {
    font-size: 34pt;
    display: inline-block;
}

.github {
    margin-bottom: 12px;
}

#score {
    font-size: 25px;
    font-weight: bold;
    margin-top: 1rem;
    margin-block: 1rem
}

#game {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
}

#number-container {
    --board-size: min(92vw, 600px); /* SAME as board */
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-left: 2rem;

    height: var(--board-size);
    width: calc(var(--board-size) / 9); /* same as one tile */
    margin-top: 10px;
}

#number-container > p {
    height: calc(90% / 9);
    width: 100%;
    
    border: 1px solid black;
    border-radius: 20%;
    
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 3rem;
    margin: 0;
    cursor: pointer;
    box-sizing: border-box;
}

#number-container > p:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0,0,0,0.18);
}

#number-container > p:active {
    transform: scale(0.98);
}

#board {
    --board-size: min(92vw, 600px);
    width: var(--board-size);
    height: var(--board-size);
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    aspect-ratio: 1 / 1;
}

.tile {
    border: 1px solid black;
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    cursor: default;
    box-sizing: border-box;
}

p.selected {
    background-color: lightblue;
}

p.incorrect {
    color: red;
}

p.correct {
    color: green;
}

.rightBorder {
    border-right: 4px solid black;
}

.bottomBorder {
    border-bottom: 4px solid black;
}

.green-text {
    color: ForestGreen;
}

footer {
    text-align: center;
    font-size: 0.875em;
    text-align: center !important;
    --bs-text-opacity: 1;
    color: #6c757d !important;
}
/* Login Panel */

#questionnaire-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;

    padding: 9px 14px;
    border-radius: 20px;
    border: none;

    cursor: pointer;
    transition: all 0.2s ease;

    margin-bottom: 10px;
}

#questionnaire-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.login-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    padding-top: 1rem;
}

#username-input,
#staff-password-input {
    padding: 6px 9px;
    border: none;
    border-radius: 8px;
    outline: none;
    font-size: 15px;
}

#username-submit-btn,
#save-settings-btn {
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: #1f1f1f;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

#username-submit-btn:hover,
#save-settings-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

#login-status,
#settings-status {
    margin-top: 10px;
    font-size: 16px;
    font-family: Arial, sans-serif;
    min-height: 24px;
}

.staff-panel {
    margin-top: 14px;
}

.staff-panel label {
    color: white;
    margin-right: 6px;
    font-weight: 500;
}

.staff-panel input {
    width: 80px;
    margin-right: 12px;
    padding: 7px 8px;
    border: none;
    border-radius: 6px;
}

.mybutton {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border-radius: 10rem;
    color: #fff;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.15rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.mybutton:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #15b5e5;
    border-radius: 10rem;
    z-index: -2;
}

.mybutton:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #5bc0de;
    transition: all 0.3s;
    border-radius: 10rem;
    z-index: -1;
}

.mybutton:hover {
    color: #fff;
}

.mybutton:hover:before {
    width: 100%;
}

.header {
    position: relative;
    text-align: center;
    color: white;
}

.header.light {
    background: linear-gradient(60deg, rgba(84, 58, 183, 1) 0%, rgba(0, 172, 193, 1) 100%);
}

.header.dark {
    background: linear-gradient(60deg, #2f4f4f 0%, #bebebe 100%);
}

.inner-header {
    height: 20%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.flex {
    /* Flexbox for containers */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.waves {
    position: relative;
    width: 100vw;
    height: 5%;
    margin-bottom: -7px;
    /* Fix for safari gap */
    min-height: 50px;
    max-height: 100px;
}

/* Visual cues */
.match-highlight {
    background-color: #ffd966;
}

.row-col-highlight {
    background-color: #dddddd;
}

.fas.fa-check {
    color: green;
}

.automation-advice {
    font-size: 18px;
    color: #000000;
    text-align: center;
}

/* Animation */

.parallax>use {
    animation: move-forever 25s cubic-bezier(.55, .5, .45, .5) infinite;
}

.parallax>use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 7s;
}

.parallax>use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 10s;
}

.parallax>use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 13s;
}

.parallax>use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 20s;
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }
    100% {
        transform: translate3d(85px, 0, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.7rem, 6vw, 2.4rem);
        line-height: 1.2;
        padding: 0 1rem;
    }

    .inner-header.flex {
        flex-direction: column;
        gap: 0.75rem;
    }

    .login-row {
        flex-direction: column;
        width: 100%;
        padding: 1rem;
    }

    #username-input,
    #staff-password-input,
    #username-submit-btn {
        width: min(92vw, 320px);
    }

    .center-screen .btn-group {
        flex-wrap: wrap;
        justify-content: center;
        margin: 0.25rem;
    }

    #finished-btn,
    #pause-btn,
    #resume-btn,
    #refresh-btn,
    #tips-btn {
        min-height: 44px;
    }

    .toast {
        width: min(92vw, 420px);
    }
}

@media (max-width: 480px) {
    header {
        padding-bottom: 12px;
    }

    .mybutton {
        width: min(92vw, 280px);
    }

    #score {
        font-size: 1.15rem;
        padding: 0 1rem;
    }

    .staff-panel {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .staff-panel input {
        width: min(92vw, 140px);
        margin-right: 0;
    }
}