:root {
    --background-color: #FFF;
    --text-color: #222;
    --muted-text-color: #888;
    --form-content-bg: #F5F5F5;
    --form-content-border: #F5F5F5;
    --bottom-bar-gradient-top: #F5F5F5;
    --bottom-bar-gradient-bottom: #eaeaeb;
    --bottom-bar-tags-bg: #ffffff;

    --sat: env(safe-area-inset-top);
    --sar: env(safe-area-inset-right);
    --sab: env(safe-area-inset-bottom); /* THIS ONE GETS US THE HOME BAR HEIGHT */
    --sal: env(safe-area-inset-left);

}

*, *:before, *:after {
    box-sizing: border-box
}

a {
      word-break: break-word;
}

body {
    font-family: -apple-system, Helvetica, Arial, sans-serif;
    font-size: 16px;
    margin: 0px;
    padding: 0px;
    background-color: var(--background-color);
    color: var(--text-color);
    color-scheme: light dark;
}

body:has(#tagsOverlay) {
    height: 100vh;
    overflow-y: hidden;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: hsl(228, 5%, 15%);
        --text-color: hsl(228, 5%, 80%);
        --form-content-bg: #444;
        --bottom-bar-tags-bg: #444;

        --form-content-border: #333333;
        --muted-text-color: #111;
        --bottom-bar-gradient-top: #323338;
        --bottom-bar-gradient-bottom: #242528;
    }
}

input[type="color"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
input[type="submit"],
select:focus,
textarea {
    font-size: 1.2rem;
    font-family: Arial, sans-serif;
}

button {
    background: transparent;
    border: 0px;
    margin: 0px;
    padding: 0px;
    text-decoration: none;
}

.container {
    max-width: 75ch;
    margin: 70px auto;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: space-around;
    width: 100%;
    padding-top: 20px;
}

.note-form-top,
.note-form-bottom {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.note-form-top {
    /*    position: sticky;
        top: 5px;*/
    background: linear-gradient(var(--bottom-bar-gradient-top), var(--bottom-bar-gradient-bottom));
    position: fixed;
    top: 0px;
    max-width: 75ch;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    border-bottom: 1px solid var(--form-content-border);
    color: var(--text-color);
    z-index: 999;
    width: 100%;
    padding: 10px;
    box-shadow: 0px -1px 10px #CCC;
}

trix-toolbar .trix-button--icon {
    display: inline-block;
    background-color: white!important;
}

trix-toolbar .trix-button-group:not(:first-child) {
    margin:0!important;
}

trix-toolbar {
    margin: 0px !important;
}

.note-top-first,
.note-top-second {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}


aeon-datepicker#editor input {
    height: 100%;
    min-height: 28px;
    width: 130px;
}

.note-top-first .cancel {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

.grow-wrap {
    /* easy way to plop the elements on top of each other and have them both sized based on the tallest one's height */
    display: grid;
}

.grow-wrap::after {
    /* Note the weird space! Needed to preventy jumpy behavior */
    content: attr(data-replicated-value) " ";

    /* This is how textarea text behaves */
    white-space: pre-wrap;

    /* Hidden from view, clicks, and screen readers */
    visibility: hidden;
}

.grow-wrap > textarea {
    /* You could leave this, but after a user resizes, then it ruins the auto sizing */
    resize: none;

    /* Firefox shows scrollbar on growth, you can hide like this. */
    overflow: hidden;
}

.grow-wrap > textarea,
.grow-wrap::after {
    /* Identical styling required!! */
    border: 1px solid black;
    padding: 15px;
    padding-bottom: 20px;
    min-height: auto;
    font: inherit;
    font-size: 1.2rem;
    /* Place on top of each other */
    grid-area: 1 / 1 / 2 / 2;
    background-color: var(--form-content-bg);
    outline: none;
    border: none;
}

trix-editor#editor {
    border: 1px solid black;
    padding: 15px;
    padding-bottom: 20px;
    min-height: auto;
    font: inherit;
    font-size: 1.2rem;
    /* Place on top of each other */
    background-color: var(--form-content-bg);
    outline: none;
    border: none;
    border-radius: 5px;
}

trix-toolbar {
    margin: 0 15px;
    /*    position: fixed;
        bottom: 72px;
        background: var(--background-color);
        z-index: 9999;*/

}

.trix-button-group.trix-button-group--file-tools,
.trix-button--icon-decrease-nesting-level,
.trix-button--icon-increase-nesting-level {
    display: none !important;
}

trix-toolbar .trix-button-group {
    margin-bottom: 0px !important;
}

.notes-list {
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 10px 0 60px 0;
}

.note-form button,
.note-form .button {
border: 1px solid #bbb;
  height: 100%;
  padding: 0px 7px;
  border-radius: 3px;
  box-shadow: 0px 1px 0px #888;
  max-height: 27px;
  color: #a0a0a0;
    background-color: white;
}

.note-form .save button {
    font-weight:bold;
    color:#111;
}

.note {
    padding: 0px 15px;
    padding-top: 40px;
    background-color: var(--background-color);
}


.note img {
    max-width: 100%;
    height: auto;
}
.note,
.note * {
    transition: 240ms all ease-in-out;
}


.mark-note-for-deletion:hover {
    color: red;
    cursor: pointer;
}

.note:has(button.mark-note-for-deletion:hover) {
    --background-color: var(--form-content-bg);
}


.note-content {
    margin-bottom: 2px;
    font-size: 1.2rem;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 1.3rem;
    /* font-weight: normal; */
    margin: 0;
    padding: 0;
}

.note-content pre {
    border: 1px solid black;
    padding: 5px;
    margin-left: -5px;
    margin-right: -5px;
    border-radius: 5px;
    font-size: 0.9rem;
    overflow: scroll;
}

.note-header,
.note-footer {
    font-size: 0.8rem;
}

.note-header {
    color: var(--text-color);
    position: sticky;
    top: 0px;
    background-color: var(--background-color);
    padding-left: 5px;
    display: flex;
    gap: 10px;
}

.note-header button {
    background: none;
    border: none;
    padding: 10px;
    margin: -10px;
    color: #999;
    text-decoration: underline;
}

.note-header button:hover {
    cursor: pointer;
}

.note-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/*.note-tags {
    margin: 0;
    padding: 0;
    display: inline-flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 5px;
}


.note-tags li {
    color: var(--text-color);
    background-color: var(--background-color);
    opacity: 0.5;
    padding: 1px 2px;
}*/

.note-tags {
    display: flex;
    gap: 10px
}

#tagsBg,
#tagsOverlay,
#menuOverlay,
#menuBg,
#keyOverlay,
#keyBg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
}

#menuBg,
#keyBg,
#tagsBg {
    z-index: 2;
    background-size: 100% 100%;
    background-position: 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px, 0px 0px;
    background-image: radial-gradient(18% 28% at 24% 50%, #CEFAFFFF 7%, #073AFF00 100%), radial-gradient(18% 28% at 18% 71%, #FFFFFF59 6%, #073AFF00 100%), radial-gradient(70% 53% at 36% 76%, #73F2FFFF 0%, #073AFF00 100%), radial-gradient(42% 53% at 15% 94%, #FFFFFFFF 7%, #073AFF00 100%), radial-gradient(42% 53% at 34% 72%, #FFFFFFFF 7%, #073AFF00 100%), radial-gradient(18% 28% at 35% 87%, #FFFFFFFF 7%, #073AFF00 100%), radial-gradient(31% 43% at 7% 98%, #FFFFFFFF 24%, #073AFF00 100%), radial-gradient(21% 37% at 72% 23%, #D3FF6D9C 24%, #073AFF00 100%), radial-gradient(35% 56% at 91% 74%, #8A4FFFF5 9%, #073AFF00 100%), radial-gradient(74% 86% at 67% 38%, #6DFFAEF5 24%, #073AFF00 100%), linear-gradient(125deg, #4EB5FFFF 1%, #4C00FCFF 100%);
    opacity: 0.85;
}

#menuOverlay,
#keyOverlay {
    display: flex;
    align-items: flex-end;
}

#menuContent,
#keyContent {
    z-index: 3;
    max-width: 75ch;
    margin: 0 auto;
    position: relative;
    padding-bottom: calc(var(--sab) + 56px);
    width: 100%;
    gap: 5px;
    display: flex;
}

#menuContent button,
#keyContent button {
    background-color: var(--background-color);
    display: inline-flex;
    border: 1px solid var(--form-content-border);
    padding: 10px 20px 10px 10px;
    border-radius: 10px;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

#keyContent input {
    background-color: var(--background-color);
    display: inline-flex;
    border: 1px solid var(--form-content-border);
    padding: 10px 20px 10px 10px;
    border-radius: 10px;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

#menuContent button svg {
    width: 24px;
    height: 24px;
}

#tagsOverlay,
#menuOverlay,
#keyOverlay {
    padding: 10px;
    overflow: scroll;
}

#tagsOverlay h1 {
    color: white;
}

#tagsContent,
#keyContent {
    position: relative;
    z-index: 3;
    pointer-events: none;
    max-width: 75ch;
    margin: 0 auto;
    overflow: scroll;
}

#keyContent input,
#keyContent button {
    pointer-events: all;
}

.new-tag {
    pointer-events: all;
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
}

.new-tag input,
.new-tag button {
    padding: 10px;

}

.new-tag input {
    flex-grow: 1;
    border: 0px;
}

.new-tag input:focus {
    outline: 0px;
}

.new-tag button {
    background: #e8e8e8;
    color: black !important;
    border-left: 1px solid #B2B2B2;
    font-size: 1rem !important;
}


.new-tag button {
    color: white;
    font-size: 1.3rem;

}

.inline-tag[data-delete-on-sync="true"] {
    display: none;
}

.tag {
    background-color: #f5f5f5;
    color: #111;
    padding: 0.5rem 1.5rem;
    display: inline-block;
    border-radius: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: all;
}

.tag button {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.tag svg {
    height: 1.2rem;
    width: 1.2rem;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    pointer-events: none;
}

#bottomBar {
    z-index: 1;
    position: fixed;
    background: linear-gradient(var(--bottom-bar-gradient-top), var(--bottom-bar-gradient-bottom));
    max-width: calc(75ch);
    width: 100%;
    padding: 5px 15px calc(var(--sab) + 10px) 15px;
    top: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
            box-shadow: 0px -1px 10px #CCC;

}

#bottomBar tags {
    flex-grow: 1;
    border-radius: 5px;
    background: var(--bottom-bar-tags-bg);
    border-color: var(--form-content-border);
    color: var(--text-color);
}

#bottomBar .tagify__input,
#bottomBar .tagify__input:before,
#bottomBar .tagify__input:after {
    color: var(--muted-text-color) !important;
}

@media screen and (min-width: 75ch) {
    #bottomBar {

        border-left: 1px solid var(--form-content-border);
        border-right: 1px solid var(--form-content-border);
        border-bottom-right-radius: 5px;
        border-bottom-left-radius: 5px;
        border: 1px solid #CCC;
        border-top:0px;
    }
}

#bottomBar button {
    border: 0px;
    color: var(--text-color);
    background: transparent;
    height: 40px;
    display: block;
}

#bottomBar button svg {
    padding: 5px;
}


.tags-look .tagify__dropdown__item {
    display: inline-block;
    vertical-align: middle;
    border-radius: 3px;
    padding: .3em .5em;
    border: 1px solid #CCC;
    background: #F3F3F3;
    margin: .2em;
    font-size: .85em;
    color: black;
    transition: 0s;
}

.tags-look .tagify__dropdown__item--active {
    border-color: black;
}

.tags-look .tagify__dropdown__item:hover {
    background: lightyellow;
    border-color: gold;
}

.tags-look .tagify__dropdown__item--hidden {
    max-width: 0;
    max-height: initial;
    padding: .3em 0;
    margin: .2em 0;
    white-space: nowrap;
    text-indent: -20px;
    border: 0;
}

tags.customLook {
    border: none;
    background: transparent;
    gap: 10px;
}

.customLook .tagify__input:before {
    color: var(--text-color)
}


.no-notes {
    text-align: center;
    color:#999;
}
/*


.customLook .tagify__input {
    min-width: 0px;
    padding:0px;
    margin:0px;
    border:0px;
    background:none;
}
*/

#tagSelect {
    display: flex;
}

#tagSelectAddButton {
    background-color: #f5f5f5;
    padding: 4px 10px;
    border-radius: 100vh;
    aspect-ratio: 1;
    display: flex;
    width: 40px;
    justify-content: center;
    align-items: center;
    border: 1px solid #e8e8e8;
    display: none;

}

#tagSelectAddButton:hover {
    cursor: pointer;
}

.tagify__input::before {
    opacity: 1 !important
}

.customLook .tagify__input {
    margin: 0px !important;
}

.customLook .tagify__tag {
    transition: none !important;
    margin-inline: 0px !important;
    margin-block: 0px !important;
}

aeon-calendar#calendar,
aeon-datepicker#editor {
    z-index: 999;
}