* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Plus Jakarta Sans", sans-serif;
    background-color: #27374D;
}

.window {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 30px;
}

.app-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 1160px;
    /* Maximum width of the app container */
    position: relative;
}

.app-border {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background-color: #e85432;
    padding: 50px;
    padding-left: 15px;
    border-radius: 24px;
    border-bottom: 10px solid #0000002a;
    border-left: 10px solid #0000002a;
}

.grid-square {
    border-top: 1px solid #0000002a;
    border-left: 1px solid #0000002a;
    transition: all 0.2s ease;
}

.grid-square.hover {
    background-color: #BDBDBD
}

.grid-square.draw {
    background-color: #565656;
}

.canvas-container {
    width: 900px;
    height: 450px;
    background-color: rgb(212, 212, 212);
    display: grid;
}

.canvas-shadow {
    background-color: #0000003e;
    height: 5px;
    border-radius: 10px 10px 0 0;
}

.canvas-shake {
    animation-name: shake;
    animation-duration: 0.5s;
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
        position: relative;
        top: 0px;
        /* Initial state: no rotation, no vertical offset */
    }

    25% {
        transform: rotate(-2deg);
        position: relative;
        top: -20px;
    }

    50% {
        transform: rotate(2deg);
        position: relative;
        top: 0px;
    }

    75% {
        transform: rotate(-2deg);
        position: relative;
        top: -20px;
    }

    100% {
        transform: rotate(0deg);
        position: relative;
        top: 0px;
    }
}

.control-panel {
    flex-grow: 1;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    color: #fdb86a;
    display: flex;
    font-size: 24px;
    margin-right: 15px;
}

.app-logo {
    margin-top: 5px;
    width: 100%;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.control-container {
    display: flex;
    justify-content: space-between;
}

.control {
    background-color: #fdb86a;
    color: #d83f1d;
    font-size: 16px;
    padding: 5px 10px 5px 10px;
    border-radius: 4px;
    border-bottom: 1px solid #0000002a;
    cursor: pointer;
    min-width: 80px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.05s ease-in-out;
}

.control:active:not(.slider-container):not(.disabled) {
    background-color: #e29b4b;
    transform: translateY(2px);
    /* Creates a "press down" animation */
}

.color-wrapper {
    position: relative;
}

#color-selector {
    position: relative;
    z-index: 2;
}

#color-picker {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    width: 80px;
    height: 35px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    z-index: 1;
}

#color-picker:hover {
    transform: translateX(-50%) translateY(-5px);
}

#color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

#color-picker::-webkit-color-swatch {
    border: none;
}

#color-picker::-moz-color-swatch {
    border: none;
}

#color-picker.visible {
    opacity: 1;
    visibility: visible;
}

.history-controls {
    display: flex;
    gap: 5px;
    width: 80px;
}

.history-controls .control {
    width: 37.5px;
    min-width: unset;
    font-size: 20px;
}

#undo-button.disabled,
#redo-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grid-size-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 0px;
    width: 100%;
}

.grid-size-label {
    font-size: 20px;
    align-self: center;
}

.slider-container {
    width: 100%;
}

.slider {
    appearance: none;
    height: 10px;
    width: 100%;
    border-radius: 5px;
    background: #ffffff88;
    -webkit-transition: .2s;
    transition: opacity .2s;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #d83f1d;
}

.slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #d83f1d;
}

.app-footer {
    position: absolute;
    bottom: 25px;
    left: calc(50% - -5px);
    transform: translateX(-50%);
    color: #fdb86a;
    font-size: 16px;
    width: calc(100% - 10px);
    text-align: center;
    text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;
    font-weight: 500;
}