* {
    /* clearing browser defaults */
    padding: 0%;
    margin: 0%;
    box-sizing: border-box;
}

:root {
    --hue: hsl(160, 100%, 50%);
    --bg-color: hsla(160, 100%, 50%, 1);
    --text-color: hsla(0, 0%, 100%, 1);
    --secondary-color: hsl(160, 100%, 96%);
    --transition-duration: 0.5s;
}

body {

    font-family: Arial, Helvetica, sans-serif;

    height: 100svh;
    width: 100%;
    background-color: var(--secondary-color);
    transition: background-color var(--transition-duration) ease;

}

.box-container {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 100%;
    width: 100%;
    border: .5rem solid var(--secondary-color);
    transition: border var(--transition-duration) ease;
}

.box {
    width: 40%;
    height: 100%;
    align-content: center;

    display: flex;
    flex-direction: column;
    justify-content: space-around;
}


/*  */
/* this styles is for the left-side box with color changable box with text */
/*  */
.colored-box-container {
    width: 60%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 30px;
}

/* this is the checkered background that shows up when decreased transparency */
.underlay {
    z-index: 1;
    width: 100%;
    height: 100%;
    background: repeating-conic-gradient(#e3e3e3 0% 25%, #aeaeae 25% 50%) 0 / 25px 25px;
}

/* this layer is on top of the underlay */
.colored-box {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    transition: background-color var(--transition-duration) ease;
    background-color: var(--bg-color);

    overflow: hidden;
    padding-inline: 5%;
}

.text {
    height: 100%;
    margin-block: 15%;
    color: var(--text-color);
    text-align: center;
    place-content: center;
    font-size: 2rem;
    font-weight: bold;
    overflow-wrap: anywhere;
    padding-block: 15%;
    padding-inline: 4rem;
    border-block: 1rem dotted var(--text-color) !important;
    overflow: hidden;
    transition: border var(--transition-duration) ease, color var(--transition-duration) ease;

    &:focus {
        outline: none;
        caret-color: blue;
    }
}


/*  */
/* right side conntrol box styles starts here */
/*  */

/* bg or text radio boxes styles */
.radios {
    margin: 8px;
    display: flex;
    justify-content: space-around;
    width: 100%;
}

input[type=radio] + label
{
    transition: all var(--transition-duration) ease;
    border-radius: 18px;
    border: 8px solid transparent;
}
input[type=radio] {
    display: none;

    &:checked+label {
        color: white;
        border: 8px solid black;
    
        text-shadow: 1px 1px 1px black;

        &#label-1 {
            background-color: var(--bg-color);
        }

        &#label-2 {
            background-color: var(--text-color);
        }
    }
}

label {
    width: 50%;
    user-select: none;
    font-size: max(1.5rem);
    text-align: center;
    align-content: center;
}


/* color customizing input ranges (or sliders) styles */
.sliders {
    padding-inline: 8%;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    width: 100%;
    margin-block: 5%;
    background: transparent;
}

/* Track styles */
.slider::-webkit-slider-runnable-track {
    height: 2rem;
    border-radius: 8px;
}

.slider::-moz-range-track {
    height: 2rem;
    border-radius: 8px;
}

/* Thumb styles */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    cursor: grabbing;
    height: 2rem;
    width: 0.6rem;
    background-color: transparent;
    border-inline: 0.2rem solid black;
    border-block: 0.5rem solid black;
    border-radius: 4px;
}

.slider::-moz-range-thumb {
    cursor: grabbing;
    height: 2rem;
    width: 0.6rem;
    background: transparent;
    border-inline: 0.2rem solid black;
    border-block: 0.5rem solid black;
    border-radius: 30px;
}


/*style for  hue slider */
.hue::-moz-range-track {

    background: linear-gradient(to right,
            hsl(0, 100%, 50%),
            hsl(30, 100%, 50%),
            hsl(60, 100%, 50%),
            hsl(90, 100%, 50%),
            hsl(120, 100%, 50%),
            hsl(150, 100%, 50%),
            hsl(180, 100%, 50%),
            hsl(210, 100%, 50%),
            hsl(240, 100%, 50%),
            hsl(270, 100%, 50%),
            hsl(300, 100%, 50%),
            hsl(330, 100%, 50%),
            hsl(360, 100%, 50%));
}

.hue::-webkit-slider-runnable-track {
    background: -webkit-linear-gradient(0deg,
            hsl(0, 100%, 50%),
            hsl(30, 100%, 50%),
            hsl(60, 100%, 50%),
            hsl(90, 100%, 50%),
            hsl(120, 100%, 50%),
            hsl(150, 100%, 50%),
            hsl(180, 100%, 50%),
            hsl(210, 100%, 50%),
            hsl(240, 100%, 50%),
            hsl(270, 100%, 50%),
            hsl(300, 100%, 50%),
            hsl(330, 100%, 50%),
            hsl(360, 100%, 50%));
}

.saturation::-moz-range-track {
    background:
        linear-gradient(to right,
            hsl(0, 0%, 50%),
            var(--hue));
}

.saturation::-webkit-slider-runnable-track {
    background: -webkit-linear-gradient(0deg, hsl(0, 0%, 50%), var(--hue));
}

.lightness::-moz-range-track {
    background:
        linear-gradient(to right,
            black,
            var(--hue),
            white)
}

.lightness::-webkit-slider-runnable-track {
    background-image: -webkit-linear-gradient(0deg, black, var(--hue), white);
}

.transparency::-moz-range-track {
    background:
        linear-gradient(to right,
            transparent,
            var(--hue)),
        /* This creates the fade effect */
        repeating-conic-gradient(#e3e3e3 0% 25%, #aeaeae 25% 50%) 0 / 10px 10px;
    ;
}

.transparency::-webkit-slider-runnable-track {
    background: -webkit-linear-gradient(0deg, transparent, var(--hue)), repeating-conic-gradient(#e3e3e3 0% 25%, #aeaeae 25% 50%) 0 / 10px 10px;
}


/* the output or the values selection and copying part */
.outputs {
    display: flex;
    justify-content: space-around;
    align-items: center;

    border-top: .5rem solid hsl(0, 0%, 100%);
    transition: border var(--transition-duration) ease;

    padding: 1rem;
    padding-top: 3rem;
}

select {
    padding-block: .5rem;
    padding-left: .5rem;
    padding-right: 1.5rem;
    text-align: left;
    background-color: #fff;
    border: 2px solid blue;

}

.color-data-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
}

.color-data {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
}

.underlayAndColor {
    position: relative;
}

.color-underlay {
    background: repeating-conic-gradient(#e3e3e3 0% 25%, #aeaeae 25% 50%) 0 / 10px 10px;
    z-index: 1;
}

.color {
    display: block;
    height: 2rem;
    width: 2rem;
    border: 2px solid blue;
    transition: background-color var(--transition-duration) ease;
}

#bg-color,
#text-color {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

#bg-color {

    background-color: var(--bg-color)
}

#text-color {
    background-color: var(--text-color);
}

.copy-container {
    display: flex;
    justify-content: flex-start;
}

#bg-color-value,
#text-color-value {
    background: transparent;
    user-select: text;
    size: 5;
    border: none;
    outline: none;
}

button {
    padding: .2rem;
}



/* stylized for phone */
@media (max-width: 600px) {
    .box-container {
        flex-direction: column;
        width: 100%;
        height: 100%;
    }

    .box {
        width: 100%;
    }

    .colored-box-container {
        width: 100%;
        height: 50%
    }

    .text {
        font-size: 1rem;
        padding-block: 5%;
        border-block: 10px dotted var(--text-color) !important;
        overflow: hidden;
    }

    input[type=radio]:checked+label {
        font-size: 1.2rem;
        /* border: 5px solid black; */
    }

    .sliders {
        padding-inline: 3%;
    }

    .slider::-webkit-slider-thumb {
        width: .6rem;
        border-inline: 4px solid black;
        border-block: 2px solid black;
    }

    .outputs {
        padding-inline: 0;
        padding-top: 1.5rem;
    }
}