:root {
    --hours-by-day: 24;
    --hour-column-size: 240px;
    --timeline-column-size: calc(var(--hour-column-size) / var(--hour-column-number));
    --timeline-column-number: calc(var(--hours-by-day) * var(--hour-column-number));
}

html,
body {
    font-family: "Pacifico", cursive;
    font-style: normal;
    margin: 0;
    padding: 0;
}

h2 {
    font-weight: 400;
    margin: 0;
}

/* GLOBAL STRUCTURE */
main {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

main > #timeline-section {
    background-color: white;
    display: flex;
    height: 40vh;
    height: 40dvh;
    overflow: auto;
}

main > #card-section {
    display: flex;
    height: 50vh;
    height: 50dvh;
}

main > #actions-section {
    box-sizing: border-box;
    display: flex;
    gap: 7px;
    height: calc(10dvh - 2 * 7px); /* Take the rest - gap * 2 */
    margin: 0 14px;
    padding-bottom: 7px;
}

/* EVENT */
.event__icon {
    background-color: white;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
}

/* TIMELINE */
.timeline-wrapper {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.timeline {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(var(--timeline-column-number), var(--timeline-column-size));
    padding: 14px;
    position: relative;
    row-gap: 10px;
}

.timeline__hour-separator,
.timeline__current-time-bar {
    bottom: 0;
    position: absolute;
    top: 0;
}

.timeline__hour-separator {
    border-left: 1px dashed #686868;
}

.timeline__current-time-bar {
    border-left: 2px solid red;
}

.timeline__current-time-bar::before {
    content: attr(data-text);
    font-size: 12px;
    margin-left: 4px;
    position: absolute;
    top: 0;
}

/* Line 0 is to show hours */
.timeline__line-0 {
    align-items: center;
    background-color: white;
    display: flex;
    grid-row: 1;
}

.timeline__event {
    align-items: center;
    border-radius: 10px;
    border: 1px solid #1e1e1e;
    cursor: pointer;
    display: flex;
    gap: 7px;
    padding: 7px;
}

.timeline__event.timeline__event--selected {
    box-shadow: 0px 0px 5px 2px #a5b2ff;
}

.timeline__event .event__icon {
    height: 36px;
    width: 36px;
}

.timeline__event__title {
    font-size: 10px;
    max-height: 48px;
    overflow: hidden;
    text-overflow: clip;
}

/* CARD */
.card {
    box-shadow: 0px 0px 5px 0px #9b9b9b;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    margin: 0 14px;
    overflow: auto;
    padding: 14px;
}

.card header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.card header .card__metadata {
    width: 100%;
}

.card .event__icon {
    height: 74px;
    width: 74px;
}

/* Footer / Action */
#actions-section .action {
    align-items: center;
    background-color: #a5d8ff;
    border: 0;
    box-shadow: 0px 0px 5px 0px #9b9b9b;
    color: black;
    cursor: pointer;
    display: flex;
    flex: 1;
    justify-content: center;
    line-height: 20px;
    text-decoration: none;
}

#actions-section .action__text {
    display: none;
}

/* Modal */
.modal {
    max-height: 80dvh;
    position: relative;
    overflow: auto;
    width: 80%;
}

.modal__title {
    float: left;
}

.modal__action-close {
    float: right;
}

.modal__content {
    clear: both;
}

/* -- tasks modal */
.tasks-by-event-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

/* USER */
.user {
    border-radius: 50%;
    box-shadow: 0px 0px 5px 0px #9f7676;
    width: 50px;
}

.users-list {
    display: flex;
    gap: 14px;
    margin: 0;
    padding: 14px 0;
}

.users-list .user {
    cursor: pointer;
}

.users-list .user.user_selected {
    box-shadow: 0px 0px 5px 2px #a5b2ff;
}

/* TASK */
ul.tasks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.task {
    cursor: pointer;
    display: inline-block;
}

.task input {
    display: none;
}

.task > div {
    background-color: #ffffff;
    border: 2px solid red;
    border-radius: 10px;
    margin-bottom: 17px; /* for user icons space */
    margin-left: 14px;
    margin-top: 14px;
    margin-right: 14px; /* for state icon space */
    padding: 18px;
    padding-bottom: 26px;
    position: relative;
    transition: all ease 200ms;
}

.task input + div::before {
    background: white;
    border-radius: 50%;
    border: 2px solid red;
    border-bottom: none;
    border-right: none;
    color: red;
    content: "✗";
    font-size: 20px;
    font-weight: bold;
    height: 35px;
    position: absolute;
    right: -14px;
    text-align: center;
    text-shadow: 1px 1px 2px #1e1e1e;
    transition: all ease 200ms;
    top: -14px;
    width: 35px;
}

.task input:checked + div {
    border-color: green;
}

.task input:checked + div::before {
    border-color: green;
    color: green;
    content: "✓";
}

.task__users {
    bottom: -17px;
    display: flex;
    gap: 7px;
    line-height: 0;
    position: absolute;
    right: 4px;
}

.task__users .user {
    height: 35px;
    width: 35px;
}

/* Medium and large screens */
@media (min-width: 600px) {
    /* TIMELINE */
    .timeline__event__title {
        font-size: 14px;
    }

    /* CARD */
    .card header .card__metadata {
        flex: 1;
        text-align: right;
    }

    /* Footer / Action */
    #actions-section .action__icon {
        margin-right: 7px;
    }

    #actions-section .action__text {
        display: inline;
    }
}
