*
{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    user-select: none;
}

html, body
{
    min-height: 100%;
    font-size: 15px;
}

body
{
    font-family: "Lato", "Geneva CY", "Lucida Grande", "Arial Unicode MS", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    background-image: url(../img/background.jpg);

    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-color: antiquewhite;
    position: relative;
}

*::-webkit-scrollbar
{
    width: 20px;
}

*::-webkit-scrollbar-button:start:decrement,
*::-webkit-scrollbar-button:end:increment
{
    height: 6px;
    display: block;
    background-color: transparent;
}

*::-webkit-scrollbar-thumb:vertical
{
    border-radius: 20px;
    background: rgba(102, 137, 100, 0.75);
    border: 7px solid transparent;
    background-clip: content-box;
}

a,
a:active,
a:visited
{
    color: dodgerblue;
    text-decoration: none;
}

a:hover
{
    text-decoration: underline;
}

[aria-hidden="true"]
{
    display: none !important;
}

/* index page */
.navigate
{
    background: white;
}

.navigate #back,
.navigate header,
.navigate #show,
.navigate #floatbar
{
    display: none;
}

.navigate ol.todo
{
    margin: 50px 0 0 0;
}
.navigate ol.todo li
{
    cursor: pointer;
}
.navigate ol.todo li:hover
{
    background-color: rgba(102, 137, 100, 0.15);
}

/* Navigation */
nav ol
{
    z-index: 100;    
    color: white;
    background: rgb(102,137,100);    
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

nav li
{
    display: inline;
}

li[role="menuitem"],
nav .title
{
    padding: 12px;
    min-width: 49px;
    line-height: 25px;
    text-align: center;
    position: relative;
}

li[role="menuitem"] li[role="menuitem"]
{
    text-align: start;
    padding: 1em 2em;
}

[role="menuitem"]:not([aria-disabled="true"]):hover
{
    background: rgb(121 160 118);
    cursor: pointer;
}

li li
{
    display: block;
}
li[role="menuitem"] > ol
{
    display: none;
}

[role="menuitem"]:not([aria-disabled="true"]):hover > ol,
[role="menuitem"]:not([aria-disabled="true"]):focus > ol,
[role="menuitem"]:not([aria-disabled="true"]):active > ol
{
    display: inline;
    position: absolute;
    width: 12em;
    left: calc(49px - 12em);
    top: 49px;   
}

nav .title
{
    text-transform: capitalize;
    flex: 1;
    text-align: left;
    font-weight: bold;
}

/* New todo input */
header
{
    margin: 60px 14px 14px 14px;
    position: relative;
    color: white;
    background: rgba(102,137,100,0.75);
    padding: 0 12px;
    border-radius: 3px;  
    display: flex;  
}

header input
{
    font-size: 16px;
    line-height: 20px;
    outline: none;
    background-color: transparent;
    color: white;
    border: none;
    padding: 10px 0;
    box-shadow: none;
    flex: 1;
}
header input::placeholder
{
    color: inherit;
    opacity: 0.7;
}

#floatbar
{
    pointer-events: none;
    position: absolute;
    top: 100vh;
    width: 25em;
    right: 0;
    bottom: 0;
}

.addbutton
{
    background-image: url(../img/plus.svg);
    background-repeat: no-repeat;
    background-position: center;
    color: white;
    background-size: 50%;
}

.addbutton.big
{
    pointer-events: all;    
    position: sticky;
    left: calc(100vw - 6em);
    top: calc(100vh - 5em);
    display: inline-block;
    width: 4em;
    height: 4em;
    background-color: rgb(102,137,100);
    background-size: 2em;
    border-radius: 100%;
    z-index: 1;
    box-shadow: 3px 3px 20px black;
}

.input
{
    position: absolute;
    background-color: rgba(102,137,100,0.3);
    box-shadow: 3px 3px 20px black;
    color: white;
    backdrop-filter: blur(5px);
    top:0;
    left: -25em;
    width: 24em;
    height: 4em;
    border-radius: 0.6em;
    display: none;
}

.addbutton.big:active .input,
.addbutton.big:focus .input,
.addbutton.big[aria-expanded="true"] .input
{
    display: inline-block;
}
.addbutton.big input
{
    padding: 0 2em;
    background-color: transparent;
    width:100%;
    height: 100%;
    color: inherit;
    font-size: 1.2em;    
}


.todo
{
    margin: 14px;
}

/* To do list items */
.todo li
{
    display: flex;
    line-height: 22px;
    background-color: white;
    color: #262626;
    outline: none;
}

.todo li[aria-checked]
{
    margin-bottom: 1px;
    border-radius: 3px;
    background: rgba(255,255,255,0.9);
}

.todo li:not([aria-checked]) > :not(.text)
{
    display: none;
}

.todo li:active,
.todo li:focus,
.todo li[aria-selected="true"]
{
    background:white
}

.todo li.child
{
    margin-left: 1em;
}

.todo li > *,
header > div
{
    flex: 0;
    padding: 12px;
    height: 46px;
    min-width: 40px;
    text-align: center;
}

.todo li.pending
{
    opacity: 0.6;
}

/* Checkbox */
.todo input
{
    display: none;
}

.todo input + div > *
{
    display: inline;
    /* padding: 0 0.6rem; */
}

.todo input:checked + div .u,
.todo input:not(:checked) + div .c
{
    display: none;
}

.todo .text
{
    flex: 1;
    text-align: left;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    /* line-height: 22px; */
    justify-content: center;
    /* align-items: center; */
}

.todo .text div
{
    text-overflow: ellipsis;
    overflow: hidden;
}

.todo .text span
{
    font-size: 12px;
    line-height: 10px;
    color: dodgerblue;
}

.todo .text span.due
{
    color: maroon;
}

.todo.complete li,
li[aria-checked="true"]
{
    opacity: 0.6;
    text-decoration: line-through;
}

.todo.complete li.pending
{
    opacity: 0.4;
}

.todo .grip,
.todo .c,
.todo .u
{
    width: 20px;
    height: 20px;
    display: inline-block;
    cursor: pointer;
}
.check .c { background-image: url(../img/checked.svg); }
.check .u { background-image: url(../img/unchecked.svg); }

.todo .grip
{
    background-image: url(../img/hamburger.svg);
}

.todo .star
{
    min-width: 45px;
    height: 19px;
    padding: 0;
    display: inline-block;
}

.star .u,
.star .c
{
    margin: 12px;
    background-repeat: no-repeat;
    background-position: center;
}
.star .u
{
    background-image: url(../img/star.svg);
    color: #262626;
}

.star .c
{
    min-width: 22px;
    background-image: url(../img/starred.svg);
    margin-top: 0;
    height: 44px;
    /* color: #d74e48; */
}

.todo li .chevron
{
    display: none;
}

.todo li[aria-expanded] .chevron,
.todo li .edit
{
    display: inline-block;
}

.chevron, .edit
{
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.chevron
{
    background-image: url(../img/chevron-right.svg);
}

li[aria-expanded="true"] .chevron
{
    background-image: url(../img/chevron-down.svg);
}

.edit
{
    background-image: url(../img/edit.svg);
}


#show
{
    margin-left: 14px;
	background: rgba(102, 137, 100, 0.75);
	color: white;
	border: none;
	font-size: 11px;
    text-transform: uppercase;
	cursor: pointer;
	outline: inherit;
    padding: 3px 10px;
}

body.modal
{
    overflow: hidden;
}

.overlay
{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;    
    z-index: 100;
}

.overlay > *
{
    display: none;
}

#editdialog
{
    background-color: white;
    width: 24em;
    height: 50%;
    position: relative;
    box-shadow: 1px 1px 10px grey;
    padding: 2em;
    display: flex;
    flex-direction: column;
}

#recurrence ~ div {
  display: none;
}

#recurrence:has(> option[value="daily"]:checked) ~ #daily,
#recurrence:has(> option[value="weekly"]:checked) ~ #weekly,
#recurrence:has(> option[value="monthly1"]:checked) ~ #monthly1,
#recurrence:has(> option[value="monthly2"]:checked) ~ #monthly2,
#recurrence:has(> option[value="annually"]:checked) ~ #annually {
  display: block;
}

.overlay.scanner #scanner
{
    display: block;
    position: relative;
    background-color: white;
    width: 48em;
    height: 50%;
}

#scanner button
{
    width: 10em;
}

#scanner video
{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

input, select
{
    border-color: rgba(0,0,0,0.1);
    border-width: 1px;
    border-bottom-color: rgba(255,255,255,0.1);
    border-right-color: rgba(255,255,255,0.1);
    border-radius: 3px;
    height: 2.5em;
    line-height: 2.5em;
    outline: none;
}

#barcode-wrapper
{
    background-color: white;
    background-image: url(../img/barcode.svg);
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0.3em;
    cursor: pointer;
}

button
{
    border-color: rgba(255,255,255,0.1);
    border-width: 1px;
    border-bottom-color: rgba(0,0,0,0.1);
    border-right-color: rgba(0,0,0,0.1);
    border-radius: 3px;
    background-color: rgb(250,250,250);
    line-height: 2.5em;
    font-weight: bold;
    width: 2em;
}

#show
{
    width: auto;
}

#save:not([disabled])
{
    color: rgb(100,100,255);
}
#save
{
    right: 2em;
}
#delete, #save, #cancel, #merge
{
    position: absolute;
    bottom: 2em;
    width: 5em;
}
button
{
    border-color: rgba(255,255,255,0.1);
    border-width: 1px;
    border-bottom-color: rgba(0,0,0,0.1);
    border-right-color: rgba(0,0,0,0.1);
    border-radius: 3px;
    background-color: rgb(250,250,250);
    line-height: 2.5em;
    font-weight: bold;
}

#cancel
{
    right: 8em;
}

#delete:not([disabled]),
#merge:not([disabled])
{
    /* background-color: rgb(255,245,245); */
    color: rgb(255,100,100);
}

#delete {
    left: 2em;
}

#merge
{
    left: 8em;
}
