/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

@font-face {
    font-family: 'IBM Plex Sans';
    src: url(/assets/IBMPlexSans-Regular-42f4a3785db8d2dfcf851be64ea0b4bbf85237909f7902ebb3d08275d834f109.ttf);
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url(/assets/IBMPlexSans-Medium-6b212c1293efee970c31d712538e7320f80bffdd4504dd5593ec0ccc89a3654f.ttf);
    font-weight: 500;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url(/assets/IBMPlexSans-Bold-048486bdb4583b49c8e3cba8ecfb89d5d9641f50282a8ff7c807720154adbb4b.ttf);
    font-weight: 700;
}

:root {
    --header-color: #F8E6A0;
    /*#F2CB05;*/
    --action-color: #9b5695;
    --action-color-dim: #cb87c6;
    --danger-color: 255, 55, 89;
    --success-color: #58FDA8;
    --success-color-dark: #47cc88;
    --success-color-darker: #256b47;
    --light-btn-text-color: #5b5b5b;
    --light-btn-text-color-hover: black;
    --dark-btn-text-color: white;
    --border-dim: #e5e5e5;
    --tag-warning-color: #ffe02a;
}

html {
    height: 100%;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14pt;
}

textarea {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14pt;
}

body {
    height: 100%;
    margin: 0;
}

h3 {
    font-size: 16pt;
    font-weight: 500;
    margin-top: 4px;
    margin-bottom: 0;
}

button, input[type=submit] {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12pt;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-repeat: no-repeat;
    color: var(--light-btn-text-color);
    background-color: #eeeeee;
}

button:disabled, input[type=submit]:disabled {
    /*FIXME: make it more contrast*/
    cursor: not-allowed;
}

button:hover, input[type=submit]:hover {
    background-color: #d7d7d7;
}

a {
    color: black;
}

a:visited {
    color: black;
}

a:hover {
    color: var(--action-color);
}

/*https://www.w3docs.com/snippets/html/how-to-make-a-div-fill-the-height-of-the-remaining-space.html*/
.application {
    display: flex;
    flex-direction: column;
    height: 100%;
}

header {
    flex: 0 1 auto;

    padding: 4px 8px;
    height: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
}

footer {
    flex: 0 0 40px;
    padding: 4px 8px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

svg {
    width: 20px;
    pointer-events: none; /* Clicking on a svg inside of a button wasn't working without this line */
}

.app-logo {
    font-size: 24pt;
    font-weight: 700;
    grid-area: 1 / 2 / 2 / 3;
    justify-self: center;
}

.header-profile {
    grid-area: 1 / 3 / 2 / 4;
    justify-self: end;
    position: relative;
}

.profile-menu-content {
    background-color: white;
    border: thin solid #8d8d8d;
    box-shadow: 0 0 20px 1px #EFEFEF;
    margin-top: 4px;
    width: 200px;
    display: none;
    position: absolute;
    right: 0;
    z-index: 1;
}

.profile-menu-element {
    text-align: left !important;
    width: 100%;
    border-radius: 0;
    background-color: white;
}

.profile-menu-element:hover {
    background-color: rgba(238, 238, 238, 0.66);
}

.show {
    display: block;
}

.form-small {
    width: 350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-content: center;
    gap: 12px
}

.root {
    margin-top: 4px;
    width: 100%;
    max-width: 1400px;
    align-self: center;
    flex: 1 1 auto;
}

.container {
    margin: 0 100px;
    height: 100%;
    border: thin solid #8d8d8d;
    box-shadow: 0 0 20px 1px #EFEFEF;
}

@media screen and (max-width: 1000px) {
    .container {
        margin: 0 50px;
    }
}

@media screen and (max-width: 700px) {
    .container {
        margin: 0;
        border-left: none;
        border-right: none;
    }
}

.breadcrumbs-wrapper {
    display: flex;
    justify-content: center;
}

.breadcrumbs {
    display: inline-block;
    background: linear-gradient(#F2CB05, #ffe778);
    border-radius: 8px;
    margin: 4px 16px 0 16px;
    padding: 4px 12px;
    font-size: 12pt;
    text-align: center;
}

/*TODO: remove me */
.container-header {
    background-color: var(--header-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 -7px 9px -7px rgba(0, 0, 0, 0.3);
}

.container-header-link {
    height: 26px;
    display: flex;
    align-items: center;
}

.swap-btn {
    width: 38px;
    height: 38px;
    color: var(--light-btn-text-color);
    background-color: white;
    padding: 6px 0;
}

.swap-btn:hover {
    color: var(--action-color);
    background-color: rgba(238, 238, 238, 0.33);
}

.swap-btn:active {
    color: var(--action-color);
    background-color: rgba(238, 238, 238, 0.66);
}

.content {
    padding: 16px;
}

.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.list-centered {
    padding: 4px 12rem 8px 12rem;
}

@media screen and (max-width: 1000px) {
    .list-centered {
        padding: 4px 6rem 8px 6rem;
    }
}

@media screen and (max-width: 800px) {
    .list-centered {
        padding: 4px 12px 8px 10px;
    }
}

.yellow-bg {
    background: linear-gradient(#F2CB05, #ffe778);
}

.new-record-inputs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: solid thin var(--border-dim);
}

.new-record-column {
    flex: 1 1 0;
    min-width: 350px;
}

.new-record-column-header {
    font-weight: 500;
    border-bottom: solid thin var(--border-dim);

    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.target-word-column-header {
    font-weight: 500;
    border-bottom: solid thin var(--border-dim);

    height: 40px;
    display: flex;
    align-items: center;
}

#translation-loader {
    height: 24px;
    display: none;
    padding-left: 8px;
    color: var(--light-btn-text-color);
}

.new-record-textarea {
    padding: 8px;
    width: 100%;
    height: 150px;
    resize: none;
    box-sizing: border-box;
    border: none;
}

@media screen and (max-width: 700px) {
    .new-record-textarea {
        height: 100px;
    }
}

.new-record-textarea:focus {
    outline: none !important;
}

.new-record-textarea:disabled {
    background-color: white;
    cursor: not-allowed;
}

.records-title {
    margin: 24px 0 0 15px;
    font-size: 18pt;
    font-weight: 500;
}

.list {
    padding: 4px 0 8px 0;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12pt;
    padding: 0 10px;
}

.delimited {
    display: block;
    box-sizing: border-box;
}

.delimited + .delimited > :not(.word-component-turbo-frame) {
    border-top: solid thin var(--border-dim);
}

.word-component-turbo-frame {
    background-color: rgba(229, 229, 229, 0.2);
    padding: 10px;
    border-top: thin solid #8d8d8d;
    border-bottom: thin solid #8d8d8d;
    box-sizing: border-box;
    box-shadow:
            inset 0 11px 8px -10px #CCC,
            inset 0 -11px 8px -10px #CCC;
}

.word-component-inline {
    padding: 0 12px;
}

.row-close-btn {
    display: flex;
    align-items: center;
    color: var(--light-btn-text-color);
    background-color: transparent;
    padding: 6px;
    margin-left: 4px;
}

.row-close-btn:hover {
    color: var(--action-color);
    background-color: transparent;
}

.detach-btn {
    display: flex;
    align-items: center;
    color: var(--light-btn-text-color);
    background-color: #eeeeee87;
}

.item:hover {
    background-color: rgba(229, 229, 229, 0.2);
}

.item + .item {
    border-top: solid thin var(--border-dim);
}

.item-content {
    /*width: 100%;*/
    flex-grow: 2;
    height: 100%;
    align-items: center;
    font-size: 12pt;
    padding: 6px;
}

.word-content-link {
    text-decoration: none;
}

.word-component-title-form {
    display: flex;
    flex-direction: column;
}

.conflict-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

a.item-content {
    text-decoration: none;
}

.item-dictionary-buttons {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.edit-record {
    padding: 12px;
    background-color: rgba(229, 229, 229, 0.2);
}

.edit-record-form {
    width: 100%;
}

.edit-record-inputs {
    gap: 4px;
    display: flex;
    flex-direction: column;
}

.edit-record-textarea {
    padding: 8px;
    width: 100%;
    height: 100px;
    resize: none;
    box-sizing: border-box;
    border: solid thin var(--border-dim);
}

.edit-record-textarea:focus {
    outline: none !important;
    border-color: var(--action-color);
}

.error-textarea {
    border-color: #CA3521;
}

.edit-record-buttons {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.tag-main {
    font-size: 10pt;
    margin: 0 6px;
    padding: 2px 6px;
    border: solid 1px black;
    border-radius: 4px;
    background-color: #d3f1a7;
}

.tag-warning {
    font-size: 10pt;
    margin: 0 6px;
    padding: 2px 6px;
    border: solid 1px black;
    border-radius: 4px;
    background-color: var(--tag-warning-color);
}

a span.tag-warning {
    text-decoration: none;
    display: inline-block;
}

a span.tag-main {
    text-decoration: none;
    display: inline-block;
}

.load-more {
    display: flex;
    justify-content: center;
}

.profile-btn {
    display: flex;
    align-items: center;
    color: var(--light-btn-text-color);
    background-color: transparent;
}

.profile-btn:hover {
    color: var(--light-btn-text-color-hover);
    background-color: #eeeeee;
}

.profile-btn:active {
    color: var(--light-btn-text-color-hover);
    background-color: rgba(242, 203, 5, 0.5);
}

.action-btn {
    display: flex;
    align-items: center;
    color: var(--dark-btn-text-color);
    background-color: var(--action-color);
}

.action-btn:hover {
    background-color: color-mix(in srgb, var(--action-color) 80%, transparent);
}

.action-btn:active {
    background-color: var(--action-color);
}

.action-btn:disabled {
    background-color: color-mix(in srgb, var(--action-color) 60%, transparent);
}

.save-btn {
    margin-top: 8px;
    padding-left: 14px;
}

.danger-btn {
    display: flex;
    align-items: center;
    color: rgb(var(--danger-color));
    background-color: transparent;
    border: none;
}

.danger-btn:hover {
    background-color: rgba(var(--danger-color), 0.1);
}

.danger-btn:active {
    background-color: rgba(var(--danger-color), 0.3);
}

.item-delete-btn {
    padding: 4px 8px;
    visibility: hidden;
}

.make-main-btn {
    padding: 4px 8px;
    visibility: hidden;
}

.main-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #d3f1a7;
}

.main-btn:hover {
    background-color: #d3f1a7;
    cursor: default;
}

.make-main-btn:hover {
    background-color: #c2c2c2;
}

@media (hover: none) {
    .item-delete-btn {
        visibility: visible;
    }

    .item-delete-btn span {
        display: none;
    }

    .make-main-btn {
        visibility: visible;
    }
}

.item:hover .item-delete-btn {
    visibility: visible;
}

.item:hover .make-main-btn {
    visibility: visible;
}

.practice-title {
    text-align: center;
    font-size: 18pt;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 4px;
}

.title-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.practice-time {
    text-align: center;
    font-size: 12pt;
    color: #a6a6a6;
}

.practice-completed {
    margin-top: 24px;
    text-align: center;
}

.question-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.question {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 620px;
    min-width: 350px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 16px 32px;
    box-sizing: border-box;
}

.question + .question {
    border-top: solid thin var(--border-dim);
}

.question-type {
    font-size: 12pt;
    color: grey;
    padding-top: 4px;
    padding-bottom: 4px;
}

.question-body {
    font-size: 18pt;
    padding-bottom: 8px;
}

.question form {
    display: flex;
    flex-direction: column;
}

.question-answer {
    font-size: 18pt;
    padding: 8px;
    width: 100%;
    height: 50px;
    resize: none;
    border: solid thin var(--border-dim);

    background-color: white;
    box-sizing: border-box;
    margin-right: -8px;
    display: block;
}

.question-answer:focus {
    outline: none !important;
    border: solid thin var(--action-color-dim);
}

.question input[type=submit] {
    margin-top: 8px;
    align-self: flex-end;
}

.answer-tag {
    display: inline-flex;
    align-items: center;
    width: min-content;
    padding: 6px 20px 6px 16px;
    /*border: solid 1px black;*/
    border-radius: 8px;
    color: #2d2d2d;
}

.answer-tag.correct {
    background-color: #d3f1a7;
    /*border-color: #94c748;*/
    color: #5b7f24;
}

.answer-tag.wrong {
    background-color: #FFD2CC;
    color: #CA3521;
    margin-bottom: 8px;
}

.dialog {
    padding: 0;
    width: 500px;
    border: thin solid black;
    border-radius: 8px;
}

.dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

.dialog-content {
    padding: 16px;
}

.dialog-header {
    width: 100%;
    height: 50px;
    display: grid;
    margin-bottom: 12px;
    grid-template-columns: 1fr 4fr 1fr;
}

.dialog-title {
    margin: 0;
    grid-area: 1 / 2 / 2 / 3;
    justify-self: center;
    align-self: center;
}

.dialog-close-btn {
    grid-area: 1 / 3 / 2 / 4;
    justify-self: end;
    align-self: start;
    display: flex;
    align-items: center;
    padding: 6px;
    color: black;
    background-color: transparent;
}

.dialog-close-btn:hover {
    background-color: #eeeeee;
}

.dictionary-creation-form {
    width: 350px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 12pt;
}

.lang-select {
    font-size: 12pt;
    height: 35px;
    width: 100%;
    border-radius: 10px;
    border: solid #bbbbbb thin;
}

.create-dictionary-btn {
    display: inline-block;
    width: max-content;
    align-self: center;
}

.error-message {
    text-align: center;
    background-color: #FFD2CC;
    color: #CA3521;
    border-radius: 10px;
    padding: 7px 6px;
}

.notice-message {
    text-align: center;
    background-color: #fff5cc;
    color: #ca9a21;
    border-radius: 10px;
    padding: 7px 6px;
}

#toast {
    position: fixed;
    top: 42px;
    right: 8px;
}

@media screen and (max-width: 700px) {
    #toast {
        right: unset;
        left: 50%;
        transform: translateX(-50%);
    }
}

.flash {
    padding: 8px 20px;
    width: 300px;
    text-align: center;

    border: thin solid #8d8d8d;
    box-shadow: 0 0 20px 1px #EFEFEF;

    background-color: white;
}

.alert {
    background-color: #fff6f5;
    color: #CA3521;
    border-color: #CA3521;
}

.notice {
    color: var(--success-color-darker);
    border-color: var(--success-color-darker);
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.word-component {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delete-word-btn {
    margin-top: 2px;
}

.word-component-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.meaning {
    border-top: solid thin var(--border-dim);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.meaning-description {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    color: grey;
    gap: 4px;
}

.meaning-editor {
    flex-grow: 1;
}

.meaning-editor-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: solid thin var(--border-dim);
    padding: 10px;
    border-radius: 10px;
}

.meaning-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.word {
    max-width: 700px;
    min-width: 350px;
    margin: 0 auto;
}

.meaning-element {
    background-color: #ffffff;

    padding: 2px 6px;
    border: solid 1px #eaeaea;
    border-radius: 4px;
}

.meaning-element-link {
    text-decoration: none;
}

.word-component-title {
    margin: 0;
    width: 100%;
}

.conflict {
    max-width: 500px;
    margin: 12px auto;
    background: linear-gradient(#fff0d0, #ffeea1);
    border-radius: 10px;
    box-shadow: 0 0 10px 1px #EFEFEF;
    padding: 16px 24px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meaning-new-word-btn {
    display: flex;
    align-items: center;
    font-size: 14pt;
}

.new-words-meaning-fields {
    display: grid;
    grid-template-columns: max-content auto;
    row-gap: 8px;
    column-gap: 12px;
    align-items: center;
    min-width: 300px;
    max-width: 500px;
    margin-top: 8px;
}
