@font-face {
    font-family: "Montserrat";
    src: url("/assets/fonts/Montserrat-Regular/Montserrat-Regular.woff2") format("woff2"),
    url("/assets/fonts/Montserrat-Regular/Montserrat-Regular.eot") format("eot"),
    url("/assets/fonts/Montserrat-Regular/Montserrat-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Montserrat";
    src: url("/assets/fonts/Montserrat-Medium/Montserrat-Medium.woff2") format("woff2"),
    url("/assets/fonts/Montserrat-Medium/Montserrat-Medium.eot") format("eot"),
    url("/assets/fonts/Montserrat-Medium/Montserrat-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Montserrat";
    src: url("/assets/fonts/Montserrat-Bold/Montserrat-Bold.woff2") format("woff2"),
    url("/assets/fonts/Montserrat-Bold/Montserrat-Bold.eot") format("eot"),
    url("/assets/fonts/Montserrat-Bold/Montserrat-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

:root {
    --note-color-yellow: #F3DB7D;
    --note-color-red: #F37D7D;
    --note-color-green: #C2F37D;
    --note-color-blue: #7DE1F3;
    --note-color-purple: #E77DF3;
    --message-color-success: #47b27d;
    --message-color-error: #f23d5b;
    --main-text-color-gray: #919191;
    --main-border-color-light-gray: #e8e8e8;
    --buttons-primary-color-blue: #457cdc;
    --buttons-hover-color-blue: #3b6db4;
    --radio-checked-shadow-blue: #007BFF;
    --color-modal-bg: rgba(0, 0, 0, 0.4);
    --modal-font-color: #1f393d;
    --modal-buttons-hover-color: #f0f0f0 ;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-red: red;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
}

ul {
    list-style: none;
}

.container {
    max-width: 1152px;
    margin: 0 auto;
}

.no_select, img {
    user-select: none;
}

/* =============== Header =============== */

.header {
    height: 60px;
    background-color: var(--color-white);
    box-shadow: 0 1px 3px 0 rgba(11, 12, 13, 0.16), 0 0 1px 0 rgba(11, 12, 13, 0.24);
}

.header_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 24px;
    object-fit: contain;
    margin: 18px 0;
}

.menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    margin: 18px 0;
}

.note_counter {
    font-weight: 500;
    font-size: 16px;
    color: var(--color-black);
}

/* =============== Main =============== */

.notes_create_wrapper {
    border-radius: 4px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 8px 12px rgba(11, 12, 13, 0.08), 0 16px 24px rgba(11, 12, 13, 0.04);
    background: var(--color-white);
}

.note-form {
    font-size: 12px;
    line-height: 2;
    color: var(--main-text-color-gray);
}

.name_wrapper, .description_form {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.description_form {
    width: 100%;
}

.note_title, .note_description {
    font-family: "Montserrat", sans-serif;
    line-height: 1.5;
    border: 1px solid var(--main-border-color-light-gray);
    border-radius: 10px;
    padding: 6px 12px;
}

.note_title {
    font-weight: 500;
    font-size: 16px;
    max-width: 344px;
    height: 36px;
}

.description_wrapper {
    display: flex;
    gap: 24px;
}

.note_description {
    height: 84px;
    resize: none;
    font-size: 14px;
    color: var(--color-black);
}

.note_description::placeholder, .note_title::placeholder {
    font-weight: 400;
    font-size: 14px;
    line-height: 1.71429;
}

/* ============== Color Selection ============== */

fieldset {
    all: unset;
}

.radio-list {
    display: flex;
    margin-bottom: 12px;
}

.radio {
    appearance: none;
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s ease;
}

.radio-list li {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    gap: 8px;
}

.radio:checked {
    box-shadow: 0 0 0 3px var(--color-white), 0 0 0 5px var(--radio-checked-shadow-blue);
}

.radio[value="yellow"] { background-color: var(--note-color-yellow); }
.radio[value="red"] { background-color: var(--note-color-red); }
.radio[value="green"] { background-color: var(--note-color-green); }
.radio[value="blue"] { background-color: var(--note-color-blue); }
.radio[value="purple"] { background-color: var(--note-color-purple); }

.add_note_button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-white);
    border: none;
    border-radius: 10px;
    padding: 6px 38px 6px 20px;
    width: 232px;
    height: 36px;
    background-color: var(--buttons-primary-color-blue);
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s ease;
}

.add_note_button:hover {
    background-color: var(--buttons-hover-color-blue);
    transform: scale(1.05);
}

/* ============== Filter ============== */

.filter-box {
    font-size: 12px;
    line-height: 2;
    margin: 24px 0 12px;

    display: flex;
    justify-content: end;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.hidden-notes-message {
    font-weight: 500;
}

.checkbox {
    display: none;
}

.custom-checkbox {
    width: 16px;
    height: 16px;
    background-size: cover;
    background-image: url('../assets/images/icons/main/checkbox-inactive.svg');
}

.checkbox:checked + .custom-checkbox {
    background-image: url('../assets/images/icons/main/checkbox-active.svg');
}

/* ============== Notes list ============== */

/* ===== Custom list ===== */
.custom-container {
    columns: 3;
    column-gap: 24px;
    margin-bottom: 24px;
}

.note-wrapper {
    border-radius: 10px;
    max-width: 368px;
    margin-bottom: 24px;
    break-inside: avoid;
    box-shadow: 0 4px 8px 0 rgba(11, 12, 13, 0.08), 0 8px 16px 0 rgba(11, 12, 13, 0.04), 0 1px 2px 0 rgba(11, 12, 13, 0.08);
}

.note-header {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-radius: 10px 10px 0 0;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}
/* ====================== */
.note-title {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
}

.buttons-wrapper {
    display: flex;
    gap: 12px;
    margin: 4px 0 0 12px;
}

.favorite-button, .delete-button {
    width: 16px;
    height: 16px;
    cursor: pointer;
    will-change: transform;
    transition: 0.3s ease;
}

.favorite-button:hover, .delete-button:hover {
    transform: scale(1.15);
}

.note-content {
    font-size: 14px;
    line-height: 1.71429;
    color: var(--color-black);
    padding: 12px;
    background-color: var(--color-white);
    border-radius: 0 0 10px 10px;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

/* ============== Messages box ============== */

.messages-box {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.71429;
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: fixed;
    right: 64px;
    bottom: 72px;
    z-index: 1000;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 10px;
    width: fit-content;
    max-width: 435px;
    max-height: 48px;
    margin-top: 5px;
    box-shadow: 0 8px 12px 0 rgba(11, 12, 13, 0.08), 0 16px 24px 0 rgba(11, 12, 13, 0.04), 0 1px 2px 0 rgba(11, 12, 13, 0.08);
    position: relative; /* нужно для шкалы */
}

.success-message {background-color: var(--message-color-success);}
.error-message {background-color: var(--message-color-error);}

.message-item img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    overflow: hidden;
    animation: progressAnimation 3s linear forwards;
}

@keyframes progressAnimation {
    0% { width: 100%; }
    100% { width: 0; }
}

.fade-out {
    animation: fadeOut 0.3s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ============== Screen messages ============== */

.no-notes-screen-massage, .no-favorite-notes-screen-massage {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    color: var(--color-black);
}

.no-notes-screen-massage {
    margin: 138px auto 0;
}

.no-favorite-notes-screen-massage {
    margin: 155px auto 0;
}

/* ============== Modal window ============== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    border-radius: 10px;
    max-width: 416px;
    margin: 0 18px;
    padding: 20px 24px 36px;
    background-color: var(--color-white);
    overflow-wrap: break-word;
    word-break: break-all;
    hyphens: auto;
}

.modal-header-wrapper {
    display: flex;
    justify-content: space-between;
}

.modal-title, .delete-message-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    color: var(--modal-font-color);
    transition: 0.3s ease;
}

.modal-cancel-button {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: 0.3s ease;
}

.modal-cancel-button:hover {
    background-color: var(--modal-buttons-hover-color);
    border-radius: 5px;
    scale: 1.15;
}

.divider {
    max-width: 416px;
    height: 1px;
    margin: 20px -24px 24px;
}

.delete-confirmation-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
}

.cancel-delete-button, .confirm-delete-button {
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    border: none;
    border-radius: 10px;
    padding: 6px 24px;
    max-width: 160px;
    max-height: 36px;
    cursor: pointer;
    transition: 0.3s ease;
}

.cancel-delete-button {
    color: var(--color-white);
    background-color: var(--buttons-primary-color-blue);
}

.confirm-delete-button {
    color: var(--message-color-error);
    background-color: var(--color-white);
}

.cancel-delete-button:hover {
    background-color: var(--buttons-hover-color-blue);
    transform: scale(1.05);
}

.confirm-delete-button:hover {
    background-color: var(--modal-buttons-hover-color);
    transform: scale(1.05);
}

/* =============== Responsive Styles =============== */

@media screen and (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }

    .note_counter,
    .no-notes-screen-massage,
    .note-header,
    .note_title,
    .note_description {
        font-size: 14px;
    }

    .note_description::placeholder,
    .note_title::placeholder {
        font-size: 12px;
        line-height: 2;
    }

    .notes_create_wrapper {
        margin-top: 20px;
    }

    .add_note_button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    .note-content {
        font-size: 12px;
    }

    .messages-box {
        right: 25px;
        bottom: 35px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .custom-container {
        columns: 2;
        column-gap: 16px;
        margin-bottom: 16px;
    }

    .header_logo {
        width: 80%;
    }

    .header_img {
        width: 18px;
        height: 18px;
    }

    .note_counter {
        font-size: 12px;
    }

    .note_title,
    .note_description {
        font-size: 13px;
    }

    .note_description::placeholder,
    .note_title::placeholder {
        font-size: 10px;
    }

    .radio {
        width: 20px;
        height: 20px;
        gap: 5px;
    }

    .radio:checked {
        box-shadow: 0 0 0 3px var(--color-white), 0 0 0 4px var(--radio-checked-shadow-blue);
    }

    .filter-box,
    .no-notes-screen-massage,
    .no-favorite-notes-screen-massage {
        font-size: 12px;
    }

    .note-wrapper {
        margin-bottom: 16px;
    }

    .no-notes-screen-massage {
        margin: 90px auto 0;
    }

    .notes_create_wrapper,
    .messages-box {
        font-size: 12px;
        right: 16px;
        bottom: 20px;
    }

    .message-item {
        padding: 12px 18px;
        max-width: 235px;
        max-height: 50px;
    }

    .modal-content {
        max-width: 380px;
    }

    .modal-title,
    .delete-message-text,
    .cancel-delete-button,
    .confirm-delete-button {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .custom-container {
        columns: 1;
        margin-bottom: 5px;
    }

    .notes_create_wrapper {
        padding: 12px;
    }

    .note-wrapper {
        max-width: 100%;
        margin-bottom: 10px;
    }

    .description_wrapper {
        flex-wrap: wrap;
        gap: 0;
    }

    .fieldset,
    .radio-list {
        width: 100%;
    }

    .radio {
        width: 24px;
        height: 24px;
    }

    .radio:checked {
        box-shadow: 0 0 0 3px var(--color-white), 0 0 0 5px var(--radio-checked-shadow-blue);
    }

    .filter-box {
        font-size: 10px;
    }
}

@media screen and (max-width: 375px) {
    .container {
        min-width: 200px;
        padding: 0 10px;
    }

    .notes_create_wrapper {
        margin-top: 12px;
    }

    .note_title,
    .note_description,
    .note-header,
    .add_note_button {
        font-size: 12px;
    }

    .note-content {
        font-size: 11px;
    }

    .filter-box {
        font-size: 8px;
        margin: 18px 0 10px;
    }

    .modal-content {
        width: 100vw;
        padding: 12px 14px 20px;
    }

    .modal-title,
    .delete-message-text,
    .cancel-delete-button,
    .confirm-delete-button {
        font-size: 12px;
        border-radius: 5px;
        padding: 3px 10px;
    }

    .divider {
        margin: 5px -14px 10px;
    }
}