@font-face {
    src: url("./Roboto-Regular.ttf");
    font-family: Roboto;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0, 0);
    -webkit-tap-highlight-color: transparent;
}

:root {
    --theme-main: #6db344;
    --theme-red: #b3446d;
    --theme-blue: #446db3;
    --theme-yellow: #edb344;

    --theme-text: white;
    scroll-behavior: smooth;
    font-size: 1.2rem;
}

body {
    font-family: Rubik, Roboto, Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;

}

body.popup-open {
    overflow: hidden;
    width: 100%;
}

header {
    padding: .5rem;
    /* background-color: white; */
    background-color: var(--theme-main);
    color: var(--theme-text);
}

header h2 {
    margin-bottom: 0;
    text-align: center;
}

header .logo {
    height: 1.2rem;
    margin-right: 1rem;
    border-radius: 5px;
}

main {
    padding: 1rem;
    background-color: white;
    /* position: relative;
    z-index: 8; */
    /* margin-bottom: 2rem; */
}

h1,
h2 {
    margin-top: 0;
}

input,
select,
button {
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    min-width: 10rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    margin-left: auto;
    margin-right: auto;

}

input[type=radio], input[type=checkbox] {
    display: inline;
    width: unset;
    min-width: unset;
    margin: 0;
    padding: 0;
}

input[type=button],
input[type=submit],
button {
    background-color: var(--theme-main);
    color: var(--theme-text);
    border: none;
}

select {
    background-color: white;
    color: black;
    border: 2px var(--theme-main) solid;
}

footer {
    height: 2rem;
    padding: 5px;
    margin-top: 1rem;
    /* border:2px black solid; */
    position: fixed;
    z-index: 3;
    bottom: 0;
    left: 0;
}

a {
    color: var(--theme-main);
}

.goal-save {
    display: block;
}

.action-container {
    width: calc(100% + 1rem);
    position: relative;
    bottom: -.5rem;
    left: -.5rem;
    background-color: rgb(77, 77, 77);
    color: white;
    padding: 0.5rem;
    z-index: 9;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    column-gap: 10px;
}

.action-container.fixed {
    position: fixed;
    top: 0;
    left: 0;
    bottom: unset;
    z-index: 100;
    height: auto;
    width: 100%;
}

.action {
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.5s;
    border-radius: 5px;
}

.action:hover {
    background-color: var(--theme-main);
    color: var(--theme-text);
}

.action i {
    /* float: left; */
    width: 4ch;
    /* margin-left: 2rem; */
    display: inline-block;
}

.calendar-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 0.5rem;
    row-gap: 0.5rem;
}

.calendar-container .month {
    border: 2px var(--theme-main) solid;
    border-radius: 5px;
    display: grid;
    grid-template-rows: repeat(2, 1fr) repeat(6, 2fr);
    grid-template-columns: repeat(7, 1fr);
    padding: 0.5rem;
    row-gap: 5px;

    transition: background-color 0.5s;
}

.calendar-container .month .day {
    text-align: center;
    border-radius: 50%;
    /* height: 100%;
     */
    width: 100%;
    aspect-ratio: 1 / 1;
    /* height: 100%; */
    display: grid;
    place-items: center;
    cursor: pointer;
    color: black;
    user-select: none;

    transition-property: background-color, border-radius, color;
    transition-duration: 0.3s;
}

.calendar-container .month .day:not(.disabled, .active):hover {
    border: 2px var(--theme-main) solid;

}

.calendar-container .month .day.active.part {
    background-color: var(--theme-yellow);
    color: var(--theme-text);
}

.calendar-container .month .day.active.full {
    background-color: var(--theme-main);
    color: var(--theme-text);
}

.calendar-container .month .day.disabled {
    color: #cccccc;
    cursor: default;
}

.calendar-container .month .week {
    display: grid;
    place-items: center;
    max-width: 3ch;
    margin: auto;
    font-size: .8rem;
}

.calendar-container .month .header {
    color: black;
    text-align: center;
    grid-column: 1 / span 7;
    margin: 0;
}

.popup-container {
    width: 100vw;
    height: 100svh;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: none;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s;
    cursor: default;
}

.popup-container.open {
    display: grid;
    place-items: center;
}

.popup-container.open.fadein {
    background-color: rgba(0, 0, 0, 0.8);
}

.popup-content {
    border-radius: 10px;
    background-color: white;
    padding: 1rem;
    transform: scale(0.01);
    transition: transform 0.3s;
    width: min(600px, 100vw - 2rem);
    text-align: center;
}

.popup-container.fadein .popup-content {
    transform: scale(1);
}

.popup-content .header {
    background-color: var(--theme-main);
    color: var(--theme-text);
    position: relative;
    width: calc(100% + 2rem);
    top: -1rem;
    left: -1rem;
    text-align: left;
    padding: 0.5rem;
    border-radius: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.popup-content .header .back,
.popup-content .header .close {
    cursor: pointer;
    margin: 10px;
}

.popup-content .header .close {
    float: right;
}

.popup-content .header .back {
    float: left;
}

.popup-content .header h1 {
    margin: 0;
    display: inline-block;
}


.popup-container.boxes.active {
    display: block;
}

.popup-container.fadein.boxes {
    background-color: rgba(0, 0, 0, 0.3);
}

.popup-container.boxes .popup-content {
    position: fixed;
    width: unset;
}

.popup-container.boxes .popup-content {
    transform: scaleX(0.01);
}

.popup-container.fadein.boxes .popup-content {
    transform: scaleX(1);
}

.popup-container.boxes .popup-content,
.fake-boxes-content {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background-color: transparent;
}


.fake-boxes-content {
    width: 9rem;
    margin: auto;
}

.fake-boxes-content .fakebox {
    width: 3rem;
    height: 3rem;
}

.box,
.fakebox {
    aspect-ratio: 1 / 1;
    height: 100%;
    transition: background 0.3s;
    border: 2px var(--_color) solid;
    display: grid;
    place-items: center;
    background-color: white;
}


.box.yellow,
.fakebox.yellow {
    --_color: var(--theme-yellow);

}

.box.red,
.fakebox.red {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
    --_color: var(--theme-red);
}

.box.blue,
.fakebox.blue {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
    --_color: var(--theme-blue);
}

.box.active {
    color: white;
    /* background: radial-gradient(circle, var(--_color) 0%, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 100%);  */
    background-color: var(--_color);
}

.box span,
.fakebox span {
    pointer-events: none;
}

.install {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 10px;
    background-color: var(--theme-main);
    color: white;
    cursor: pointer;
    text-align: left;
    box-shadow: grey 1px -1px 5px 3px;
    border-top-right-radius: 5px;
    display: none;
}

.install.active {
    display: block;
}

.install .close {
    position: relative;
    bottom: -3px;
    font-size: 1.5rem;
    display: inline-block;
}

#settingsPopup .popup-content input[type=button], #settingsPopup .popup-content button {
    width: 100%;
}

@media screen and (max-width: 1200px) {
    .calendar-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 900px) {
    .calendar-container .month .day:not(.disabled):hover {
        border: none;
    }

    .calendar-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 800px) {
    .action .action-text {
        display: none;
    }

    .popup-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

@media screen and (max-width: 600px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }
}