﻿html {
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.3125rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2.652rem;
    --font-size-4xl: 4rem;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
    background-color: #fff;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
    font-weight: 700;
    font-size: 2em;
    margin: 4rem auto;
    text-align: center;
    letter-spacing: inherit;
}

button {
    height: 3rem;
    width: 6rem;
    border-radius: 0.5rem;
    font-size: 0.5em;
}

label {
    padding-right: 1rem;
    padding-top: 1rem;
}

/* --- Colours --- */
.custom-color-container {
    padding-top: 0.5em;
}

#custom-color-picker {
    visibility: hidden;
    width: 0px;
    padding: 0;
    margin: 0;
}


.palette-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.palette-row {
    display: flex;
    flex-direction: column;
    margin: 0.1rem;
}

.color, .custom-color {
    background-color: #666;
    width: 2rem;
    height: 2rem;
    margin: 0.1rem;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: inline-block;
    outline: none;
    border: 2px solid transparent;
}

    .color:hover, .custom-color:hover {
        transform: scale(1.1);
    }

.color[aria-checked="true"], .custom-color[aria-checked="true"] {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 1.3);
}


    /* --- Grid --- */
.grid-container {
    display: grid;
    gap: 0.25rem;
    margin-top: 20px;
    grid-auto-flow: row dense;
    justify-content: center;
    background-color: #333;
    border-color: #333;
    outline-color: #333;
    outline: auto;
}

.grid-cell {
    width: 1em;
    height: 1em;
    background-color: #fff;
    cursor: pointer;
}

.grid-controls {
    margin-top: 1rem;
}


/* --- Saved States --- */

.saved-states {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.saved-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.thumbnail-container {
    margin-bottom: 1rem;
}

/*
.saved-state-button {
    margin-left: 10px;
}
    */
/* --- Input --- */
input[type="number"] {
    text-align: center;
    border: none;
    border-radius: 6px;
    padding: 0.5em;
    margin-right: 0.5em;
    min-width: 24px;
    min-height: 24px;
    width: 1.75em;
    height: 1.75em;
    font-size: 1em;
    background-color: #f4f4f4;
    color: #333;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
}

    input[type="number"]:focus {
        outline: none;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
    }

    input[type="number"]::-webkit-input-placeholder {
        color: #999;
    }

    input[type="number"]::-moz-placeholder {
        color: #999;
    }

    input[type="number"]:-ms-input-placeholder {
        color: #999;
    }

    input[type="number"]::placeholder {
        color: #999;
    }



/* --- Scrolling Pattern --- */
.scrolling-pattern-grid {
    display: grid;
    gap: 0.25rem;
    margin-top: 20px;
    grid-auto-flow: row dense;
    justify-content: center;
    background-color: #333;
    border-color: #333;
    outline-color: #333;
    outline: auto;
    overflow-x: auto;
    white-space: nowrap;
    cursor: grab;
}

.scrolling-pattern-container {
    overflow-x: hidden;
    position: relative;
}

.scrolling-pattern-grid {
    overflow-x: scroll;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for Internet Explorer and Edge */
}

    .scrolling-pattern-grid::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
    }


/* --- Text Effects --- */
.allsides {
    background: linear-gradient(currentColor 0 0) var(--p, 100%) 0, linear-gradient(currentColor 0 0) 0 var(--d, 0), linear-gradient(currentColor 0 0) var(--d, 0) 100%, linear-gradient(currentColor 0 0) 100% var(--p, 100%);
    background-size: var(--d, 0) 3px, 3px var(--d, 0);
    background-repeat: no-repeat;
    transition: 0.5s, background-position 0s 0.5s;
}

    .allsides:hover {
        --d: 100%;
        --p: 0%;
        text-shadow: 0px 0px 3rem black;
    }


/* --- Coded CSS Rainbow --- */
.rainbow:hover {
    -webkit-animation: rainbow 3s infinite;
    -ms-animation: rainbow 3s infinite;
    -o-animation: rainbow 3s infinite;
    animation: rainbow 3s infinite;
}

@-webkit-keyframes rainbow {
    0% {
        color: #ff0000;
    }

    10% {
        color: #ff8000;
    }

    20% {
        color: #ffff00;
    }

    30% {
        color: #80ff00;
    }

    40% {
        color: #00ff00;
    }

    50% {
        color: #00ff80;
    }

    60% {
        color: #00ffff;
    }

    70% {
        color: #0080ff;
    }

    80% {
        color: #0000ff;
    }

    90% {
        color: #8000ff;
    }

    100% {
        color: #ff0080;
    }
}

@-ms-keyframes rainbow {
    0% {
        color: #ff0000;
    }

    10% {
        color: #ff8000;
    }

    20% {
        color: #ffff00;
    }

    30% {
        color: #80ff00;
    }

    40% {
        color: #00ff00;
    }

    50% {
        color: #00ff80;
    }

    60% {
        color: #00ffff;
    }

    70% {
        color: #0080ff;
    }

    80% {
        color: #0000ff;
    }

    90% {
        color: #8000ff;
    }

    100% {
        color: #ff0080;
    }
}

@-o-keyframes rainbow {
    0% {
        color: #ff0000;
    }

    10% {
        color: #ff8000;
    }

    20% {
        color: #ffff00;
    }

    30% {
        color: #80ff00;
    }

    40% {
        color: #00ff00;
    }

    50% {
        color: #00ff80;
    }

    60% {
        color: #00ffff;
    }

    70% {
        color: #0080ff;
    }

    80% {
        color: #0000ff;
    }

    90% {
        color: #8000ff;
    }

    100% {
        color: #ff0080;
    }
}

@keyframes rainbow {
    0% {
        color: #ff0000;
    }

    10% {
        color: #ff8000;
    }

    20% {
        color: #ffff00;
    }

    30% {
        color: #80ff00;
    }

    40% {
        color: #00ff00;
    }

    50% {
        color: #00ff80;
    }

    60% {
        color: #00ffff;
    }

    70% {
        color: #0080ff;
    }

    80% {
        color: #0000ff;
    }

    90% {
        color: #8000ff;
    }

    100% {
        color: #ff0080;
    }
}

/* --- Responsive --- */
/* TODO: Additional responsive styles as needed */
@media screen and (max-width: 768px) {
    body {
        margin: 10px;
    }

    .palette {
        overflow-x: scroll;
    }

    input[type="number"] {
        font-size: 12px;
    }

    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        margin: 0;
    }
}

/* --- Colour Themes --- */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #333;
        color: rgba(255, 255, 255, 0.87);
    }

    .grid-cell {
        background-color: #666;
    }

    input [type="number"] {
        background-color: #444;
        color: rgba(255, 255, 255, 0.87);
        box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1);
    }

    button {
        background-color: #444;
        color: rgba(255, 255, 255, 0.87);
    }
        button:hover {
            background-color: #333;
        }
}

/*
    .scrolling-pattern-grid:active {
        cursor: grabbing;
    }

    .scrolling-pattern-grid .grid-cell {
        display: inline-block;
        width: 30px; /* Adjust width as needed */
/*  height: 30px; /* Adjust height as needed */
/*   border: 1px solid #ccc; /* Optional: Add border for grid cells */
/*  }*/
