/* Header styling */
.todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    height: var(--header-height);
    box-shadow: var(--todos-box-shadow);
    background-color: var(--header-bg);
    color: var(--primary-color);
}

.todo-header > * {
    height: inherit;
    vertical-align: baseline;
}

/* Header logo element styling */
.header__logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 0 var(--header-pad-x);
}

.header__logo > * {
    height: var(--logo-sz);
}

.logo__menu--mob {
    cursor: pointer;
    display: none;
}

.logo__icon {
    width: var(--logo-sz);
    height: var(--logo-sz);
}

.logo__title {
    font: 600 24px/normal var(--ff-acc);
    color: var(--clr-prim-400);
}

/* Header search element styling */
.header__search {
    display: block;
    height: var(--header-height);
    flex: 1;
    padding: 0 1rem;
    overflow: hidden;
    background-color: transparent;
    color: var(--primary-color);
}

.header__search .search-wrapper {
    height: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header__search .search-wrapper .search__close--mob {
    cursor: pointer;
    display: none;
    height: 20px;
}

.header__search .search-wrapper .search__close--mob:hover,
.header__search .search-wrapper .search__close--mob:active {
    color: var(--clr-prim-300);
}

.header__search .search-wrapper .search__close--mob i {
    font-size: 20px;
    margin: auto;
}

.header__search .search-wrapper .search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: var(--searchbox-max-width);
    height: var(--search-wrapper-height);
    margin: auto;
    background-color: var(--todo-bg);
    color: inherit;
    padding: .75rem;
    border-radius: .25rem;
    overflow: hidden;
}

.header__search .search-wrapper .search .search__searchbtn {
    height: 20px;
    display: flex;
}

.header__search .search-wrapper .search .search__searchbtn i {
    font-size: 20px;
    margin: auto;
}

.header__search .search-wrapper .search .search__clear {
    display: flex;
    cursor: pointer;
    height: 20px;
}

.header__search .search-wrapper .search .search__clear:hover,
.header__search .search-wrapper .search .search__clear:active {
    color: var(--clr-prim-300);
}

.header__search .search-wrapper .search .search__clear i {
    font-size: 20px;
    margin: auto;
}

.header__search .search-wrapper .search .search__searchbtn,
.header__search .search-wrapper .search .search__searchbox {
    height: var(--searchbox-height);
}

.header__search .search-wrapper .search .search__searchbtn {
    display: flex;
}

.header__search .search-wrapper .search .search__searchbtn i {
    margin: auto;
}

.header__search .search-wrapper .search .search__searchbox {
    border: none;
    outline: none;
    background-color: transparent;
    color: inherit;
    padding: 0 .75rem;
}

.header__search .search-wrapper .search .search__searchbox::placeholder {
    font: inherit;
    color: var(--placeholder-text-color);
}

.header__search .search-wrapper .search .search__clear i {
    margin: auto;
}

/* Menu and search mobile styling */
.todo-header .header__search--mob {
    display: none;
}

.todo-header .header__search--mob .search__searchbtn--mob {
    display: flex;
    height: inherit;
    cursor: pointer;
    padding: 0 var(--header-pad-x);
}

.header__logo .logo__menu--mob i,
.header__search--mob .search__searchbtn--mob i {
    margin: auto;
    font-size: 20px;
}

.header__logo .logo__menu--mob:hover,
.header__logo .logo__menu--mob:active,
.header__search--mob .search__searchbtn--mob:hover,
.header__search--mob .search__searchbtn--mob:active {
    color: var(--clr-prim-300);
}

/* Main section styling */
.todo-main {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
    flex: 1;
    display: flex;
    flex-flow: row nowrap;
    background-color: var(--main-bg);
    color: var(--primary-color);
}

/* Menu styling */
.menu-wrapper {
    min-width: 20%;
    height: 100%;
    background-color: var(--clr-prim-100);
    color: var(--primary-color-light);
    white-space: nowrap;
    overflow: hidden;
}

.menu--lg {
    font-weight: 500;
    background-color: inherit;
    color: inherit;
}

.menu__item .content {
    width: 100%;
    padding: .75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu__item .content:hover,
.todo__option:hover {
    background-color: var(--clr-prim-300);
    color: var(--white-prim);
}

.menu__item .content .logo {
    width: 100%;
}

.menu__item .content i {
    font-size: 1.5rem;
    min-width: 1.75rem;
}

/* Main content section styling */
.todo-main .content-wrapper,
.todo-main .todos-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: inherit;
    color: inherit;
    overflow-y: auto;
}

.todo-main .todos-wrapper {
    padding: 0 .625rem;
}

/* Messages section styling */
.todo-main .content-wrapper .msgs {
    width: 100%;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.todo-main .content-wrapper .msgs .no-todos-msg,
.todo-main .content-wrapper .msgs .not-found-msg {
    margin: auto;
    color: var(--msgs-color);
}

.todo-main .content-wrapper .msgs .no-todos-msg .no-todos-msg__icon,
.todo-main .content-wrapper .msgs .not-found-msg .not-found-msg__icon {
    font-size: 400%;
}

.todo-main .content-wrapper .msgs .no-todos-msg .no-todos-msg__text,
.todo-main .content-wrapper .msgs .not-found-msg .not-found-msg__text {
    font-size: 120%;
    padding-top: .5rem;
}

/* Todos summary styling */
.todos-summary {
    height: 4.25rem;
    border-bottom: 1px solid var(--modal-border-color);
}

.todos-summary .content {
    width: inherit;
    max-width: var(--todos-max-width);
    height: inherit;
    margin: auto;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.todos-summary .content .todos-summary__message {
    font-size: 18px;
}

/* New todo button styling */
.new-todo--cta {
    padding: .6rem 1.4rem;
    border-radius: 100vh;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: var(--clr-prim-400);
    color: var(--white-prim);
}

.new-todo--cta:focus {
    outline: 3px solid var(--clr-prim-500);
    outline-offset: 3px;
    background-color: var(--clr-prim-500);
}

.new-todo--cta .btn-content {
    display: flex;
    overflow: hidden;
    gap: .25rem;
}

.new-todo--cta .btn-content i {
    margin: auto;
}

.new-todo--cta .btn-content .new-todo__text {
    padding: 0 2px;
}

/* Todos styling */
.todos {
    width: 100%;
    max-width: var(--todos-max-width);
    margin: .5rem auto;
    display: grid;
    border-radius: var(--todos-border-radius);
    box-shadow: var(--todos-box-shadow);
    background-color: var(--todos-bg);
    color: var(--primary-color);
}

.todos:first-of-type {
    margin: 2rem auto .5rem;
}

.todos:last-of-type {
    margin-bottom: 2rem;
}

.todos > * {
    padding: .5rem 1rem;
}

.todos .todos__timestamp {
    border-bottom: 1px solid var(--todos-border-color);
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.todos .todos__timestamp .timestamp__id {
    font-size: 107.5%;
    font-weight: 500;
    color: var(--clr-prim-400);
    letter-spacing: .035px;
}

.todos .todos__timestamp .timestamp__pending-todos {
    color: #8b8b8b;
    font-size: 95%;
    font-weight: 400;
}

.todos .todos__todo-wrapper .todo {
    display: grid;
    grid-template-columns: auto 1fr auto;
    width: 100%;
    height: var(--todo-height);
    margin: .5rem auto;
    border-radius: var(--todo-border-radius);
    background-color: var(--todo-bg);
    color: var(--primary-color);
    opacity: 1;
}

.todos .todos__todo-wrapper .todo.selected {
    background-color: hsl(249, 69%, 78%);
    color: var(--clr-prim-600);
}

.todos .todos__todo-wrapper .todo.completed.selected {
    background-color: rgba(172, 160, 238, .95);
}

.todos .todos__todo-wrapper .todo.completed {
    background-color: var(--todo-completed-bg);
}

.todos .todos__todo-wrapper .todo.completed .todo__icon,
.todos .todos__todo-wrapper .todo.completed .todo__content {
    opacity: .25;
}

.todos .todos__todo-wrapper .todo.completed .todo__icon {
    position: relative;
}

.todos .todos__todo-wrapper .todo.completed .todo__icon::after {
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    font: var(--fa-font-solid);
    font-size: 1.1rem;
    content: "\f058";
    position: absolute;
    top: 45%;
    right: 0;
    transform: translate(-50%, -50%);
    background-color: transparent;
    color: inherit;
}

.todos .todos__todo-wrapper .todo.completed .todo__content .content__text {
    font-weight: 300;
    font-style: italic;
    text-decoration: line-through;
}

.todos .todos__todo-wrapper .todo .todo__icon,
.todos .todos__todo-wrapper .todo .todo__actions {
    display: flex;
    height: 100%;
    padding: 1rem;
    font-style: normal;
}

.todos .todos__todo-wrapper .todo .todo__icon {
    border-right: 1px solid var(--todo-icon-border-color);
}

.todos .todos__todo-wrapper .todo.selected .todo__icon {
    border-right: 1px solid hsl(249, 67%, 70%);
}

.todos .todos__todo-wrapper .todo .todo__icon i {
    font-size: var(--todo-icon-sz);
    background: -webkit-linear-gradient(hsl(240, 100%, 90%), hsl(240, 100%, 75%), hsl(240, 100%, 60%));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.todos .todos__todo-wrapper .todo .todo__icon > *,
.todos .todos__todo-wrapper .todo .todo__actions > * {
    margin: auto;
}

.todos .todos__todo-wrapper .todo .todo__content {
    display: flex;
    overflow: hidden;
}

.todos .todos__todo-wrapper .todo .todo__content .content__text {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: auto;
    height: var(--todo-icon-sz);
    padding: 0 1rem;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: transparent;
    color: inherit;
    cursor: pointer;
    display: flex;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn:hover,
.todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn:active {
    background-color: #a8a8a8;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn:focus {
    outline: 3px solid var(--clr-prim-400);
    outline-offset: 3px;
}

body.dark-mode-on .todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn:hover,
body.dark-mode-on .todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn:active {
    background-color: #484848;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions-btn i {
    margin: auto;
}


/* Todo actions styling */
.todos .todos__todo-wrapper .todo .todo__actions {
    position: relative;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions__options-nav {
    position: absolute;
    z-index: 1000;
    top: 0;
    right: -1%;
    width: fit-content;
    white-space: nowrap;
    font-weight: 500;
    background-color: var(--todo-actions-bg);
    color: var(--todo-actions-color);
    padding: .5rem 0;
    box-shadow: var(--todos-box-shadow);
    border-radius: var(--todo-border-radius);
    overflow: hidden;
}

/* Setting actions modal to bottom right instead of top right for last todo item */
.todos .todos__todo-wrapper .todo:last-child .todo__actions .todo__actions__options-nav {
    top: unset;
    bottom: 0;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions__options-nav .options-nav__option {
    padding: .5rem 1rem;
    cursor: pointer;
}

.todos .todos__todo-wrapper .todo .todo__actions .todo__actions__options-nav .options-nav__option:hover,
.todos .todos__todo-wrapper .todo .todo__actions .todo__actions__options-nav .options-nav__option:active {
    background-color: var(--clr-prim-300);
    color: var(--white-prim);
}

/* Tablet responsive styling */
@media (max-width: 840px) {
    .header__logo {
        gap: 1.575rem;
    }

    .logo__menu--mob {
        display: flex;
    }

    .logo__icon {
        display: none;
    }

    .header__search {
        transform: translateX(100vw);
        transition: transform .3s ease-out;
    }

    .header__search .search-wrapper .search .search__searchbtn {
        display: none;
    }

    .header__search.full-screen-search {
        transform: translateX(0);
    }

    .header__search.full-screen-search .search-wrapper .search,
    .header__search.full-screen-search .search-wrapper .search__close--mob {
        display: flex;
    }

    .todo-header .header__search--mob {
        display: block;
    }

    .menu-wrapper {
        min-width: 40%;
        margin-top: var(--header-height);
        box-shadow: 0 0 8px 0 rgba(var(--todos-shadow-color-rgb-dark), .3), 0 0 24px 0 rgba(var(--todos-shadow-color-rgb-dark), .15);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1;
        transform: translateX(-100vw);
        transition: transform .3s ease-in-out;
    }

    .menu-wrapper.toggle-menu {
        transform: translateX(0);
    }
}

/* Mobile responsive styling */
@media (max-width: 480px) {
    .menu-wrapper {
        min-width: 60%;
    }

    .header__logo .logo__menu--mob:hover {
        color: inherit;
    }

    .header__logo .logo__menu--mob:active {
        color: var(--clr-prim-300);
    }

    .todos-summary .content .todos-summary__message {
        font-size: 95%;
    }

    .todo-main .content-wrapper .msgs .no-todos-msg .no-todos-msg__icon,
    .todo-main .content-wrapper .msgs .not-found-msg .not-found-msg__icon {
        font-size: 350%;
    }

    .todo-main .content-wrapper .msgs .no-todos-msg .no-todos-msg__text,
    .todo-main .content-wrapper .msgs .not-found-msg .not-found-msg__text {
        font-size: 105%;
    }

    .new-todo--cta {
        background-color: transparent;
        color: var(--clr-prim-400);
        padding: .5rem;
        border: none;
        border-radius: 2px;
    }

    .new-todo--cta:hover {
        background-color: transparent !important;
        color: var(--clr-prim-500);
    }

    .new-todo--cta:focus {
        background-color: transparent;
    }

    .new-todo--cta .btn-content i {
        font-size: 1.75rem;
    }

    .new-todo--cta .btn-content .new-todo__text {
        display: none;
    }
}

@media (max-width: 360px) {
    .todos-summary .content .todos-summary__message {
        font-size: 90%;
    }
}

@media (max-width: 240px) {
    .todos-summary .content .todos-summary__message {
        font-size: 85%;
    }
}