.modal-block {
    --cart-width: 500px;
    --cart-height: 300px;
    --cart-note-height: 380px;
    --cart-folder-height: 280px;
    --cart-sort-height: 380px;
    --modal-radius: 20px;
    --header-font: 22px;
    --cross-size: 22px;
    --cross-multiplier: 0.2;
    --title-height: 53px;
    --padding-title-tb: 10px;
    --margin-content: 15px;

    display: none;
    border: none;

    .global-shadow {
        display: block;
        position: fixed;
        top: 0px;
        left: 0px;
        width: 100%;
        height: 100%;
        z-index: 1000;
        background:rgba(0,0,0,.7);
        
        .modal-cart {
            z-index: 1001;
            /* display: block; */
            width: var(--cart-width);
            height: auto;
            background-color: var(--bg-color);
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            border-radius: var(--modal-radius);
            max-width: 100%;

            display: none;

            .modal-cart-header {
                display: flex;
                flex-wrap: nowrap;
                justify-content: space-between;
                width: 100%;
                height: var(--title-height);
                background-color: var(--header-color);
                padding: var(--padding-title-tb) 15px;
                border-top-left-radius: var(--modal-radius);
                border-top-right-radius: var(--modal-radius);
    
                .modal-title {
                    max-width: 80%;
                    font-weight: 600;
                    font-size: var(--header-font);
                }
                .modal-header-right {
                    display: flex;
                    justify-content: center;
                    align-items: center;
        
                    .modal-cross {
                        width: var(--cross-size);
                        fill:rgb(63, 63, 63);
                        cursor: pointer;
                        transition: all 0.2s ease;
            
                        &:hover {
                            transform: scale(1.2)
                        }
                    }
                }
            }
            hr {
                margin: 0px;
            }
            .modal-cart-content {
                margin: 15px;
                height: auto;
                
                /* Общие стили для всех форм в модалках */
                form {
                    label {
                        display: block;
                        position: relative;
                        margin-bottom: 10px;
                    }
                    
                    input {
                        display: block;
                    }
                    
                    textarea {
                        resize: none;
                    }
                    
                    .form-marker {
                        label {
                            display: inline;
                        }
                        input {
                            display: none;
                        }
                        input + .marker {
                            opacity: 60%;
                        }
                        input:checked + .marker {
                            border-width: 1px;
                            opacity: 100%;
                            box-shadow: 0px 0px 5px 5px rgba(0, 0, 0, 0.1);
                        }
                    }
                    
                    .modal-input {
                        display: block;
                        width: 100%;
                        border: var(--border-color) 1px solid;
                        border-radius: 4px;
                        outline: none;
                    }
                    
                    .error {
                        font-size: 14px;
                        display: none;
                        justify-content: center;
                        align-items: center;
                        position: absolute;
                        z-index: 10;
                        top: calc(100% + 5px);
                        left: 0;
                        background-color: #d63031;
                        color: #ffffff;
                        border-radius: 3px;
                        padding: 4px 8px;
                        transition: all ease-in-out 260ms;
                        
                        &:after,
                        &:before {
                            bottom: 100%;
                            left: 16px;
                            border: solid transparent;
                            content: "";
                            height: 0;
                            width: 0;
                            position: absolute;
                            pointer-events: none;
                        }
                        
                        &:before {
                            border-bottom-color: #d63031;
                            border-width: 5px;
                            margin-left: -5px;
                        }
                    }
                    
                    button.submitButton {
                        display: block;
                        margin-top: 20px;
                        padding: 12px 35px;
                    }
                    
                    &.form-sort {
                        label {
                            display: block;
                        }
                        input {
                            display: inline;
                        }
                    }
                }
                
                /* Стили для кнопок в модалках */
                .buttons-row {
                    margin-top: 10px;
                    display: flex;
                    width: 100%;
                    justify-content: space-evenly;
                    flex-wrap: nowrap;
                }
                
                /* Стили для загрузки файлов */
                .file-input-label {
                    display: block;
                    
                    span {
                        display: block;
                    }
                    
                    .file-input-wrapper {
                        position: relative;
                        display: inline-block;
                        
                        .file-input-button {
                            border: 1px solid var(--border-color);
                            border-radius: 4px;
                            padding: 6px 12px;
                            background-color: var(--header-sector-color);
                            cursor: pointer;
                            font-family: inherit;
                            font-size: inherit;
                            color: black;
                            font-weight: 600;
                            position: relative;
                            z-index: 1;
                            
                            &:hover {
                                background-color: var(--header-sector-hover-color);
                            }
                        }
                        
                        .file-input {
                            position: absolute;
                            left: 0;
                            top: 0;
                            opacity: 0;
                            width: 0;
                            height: 0;
                            border: none;
                            outline: none;
                            pointer-events: none;
                        }
                    }
                }
                
                #crtNoticeForm {
                    > label {
                        display: flex;
                        align-items: center;
                        margin-bottom: 10px;
                        
                        > span {
                            width: 100px;
                            flex-shrink: 0;
                        }
                        
                        > div {
                            flex: 1;
                            position: relative;

                            > input {
                                max-width: 120px;
                            }
                        }
                        
                        &[for="fNoticeName"] {
                            > div > input {
                                max-width: none;
                                width: 100%;
                            }
                        }
                    }
                    
                    .notice-mode-switch {
                        display: flex;
                        align-items: center;
                        gap: 5px;
                        
                        > span {
                            line-height: 34px;
                            height: 34px;
                        }
                        
                        label.switch {
                            margin-bottom: 0;
                        }
                    }
                    
                    .notice-mode-fields {
                        label {
                            display: flex;
                            align-items: center;
                            margin-bottom: 10px;
                            
                            > span {
                                width: 100px;
                                flex-shrink: 0;
                            }
                            
                            > div {
                                flex: 1;
                                position: relative;

                                > input {
                                    max-width: 120px;
                                }
                            }
                        }
                        
                        .period-date-fields {
                            display: grid;
                            grid-template-columns: repeat(2, 1fr);
                            gap: 10px;
                            margin-bottom: 10px;
                            
                            @media (max-width: 480px) {
                                grid-template-columns: 1fr;
                            }
                            
                            label {
                                margin-bottom: 0;
                            }
                            
                            #periodErrorField,
                            #dateTimeError,
                            #periodicDateTimeError  {
                                position: static;
                                grid-column: 1 / -1;
                            }
                        }
                        
                        p {
                            margin-bottom: 10px;
                            color: #059e85;
                            font-weight: 600;
                        }
                    }
                }
            }
            
            /* Специфичные стили для разных типов модалок */
            &.delete-cart {
                height: 170px;
            }
            &#modalAddImages {
                height: 230px;
            }
        }
    }
}

.btn-default {
    display: inline-block;
    cursor: pointer;
    /* font-size: 16px; */
    padding: 12px 24px;
    margin: 0px 5px;
    text-align: center;
    background-color: var(--header-sector-color);
    /* border: none; */
    border: 1px solid var(--btn-border-color);
    color: black;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.1s ease;
    
    &:hover {
        background-color: var(--header-sector-hover-color);
        font-weight: 600;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    }
}

.btn-danger {
    background-color: #fd7e7ed3;

    &:hover {
        background-color: #ff4545;
    }
}

.input {
    display: block;
    width: 100%;
    max-width: 250px;
    min-width: 100px;
    border: var(--border-color) 1px solid;
    border-radius: 4px;
    outline: none;
}

label.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    scale: 0.8;

    input {
        opacity: 0;
        width: 0; /* hide checkbox */
        height: 0;

        &:checked + .slider {
            background-color: #2196F3;
        }
        &:focus + .slider {
            box-shadow: 0 0 1px #2196F3;
        }
        &:checked + .slider:before {
            -webkit-transform: translateX(26px);
            -ms-transform: translateX(26px);
            transform: translateX(26px);
        }
    }
    
    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        -webkit-transition: .4s;
        transition: .4s;

        &:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            -webkit-transition: .4s;
            transition: .4s;
        }
        &.round {
            border-radius: 34px;

            &:before {
                border-radius: 50%;
            }
        }
    }
}

.air-datepicker-global-container { /* Air DatePicker */
    .air-datepicker-cell.-day-.-weekend-:not(.-disabled-, .-other-month-) {
        color: #e93c3c;
    }
}

.gear-context-menu {
    position: absolute;
    display: none;
    /* font-family: 'Montserrat', sans-serif; */

    .menu {
        
        display: flex;
        flex-direction: column;
        background-color: #fff;
        border-radius: 10px;
        box-shadow: 0 10px 20px rgb(64 64 64 / 20%);
        padding: 10px 0;
        list-style: none;
        margin: 0;

        li {
            position: relative;
            display: flex;
            width: 100%;
            align-items: center;
            padding: 10px 30px 10px 15px;
            color: #000;
            font-weight: 500;
            transition: 0.2s linear;

            &:hover {
                background:#e2e3e7;
                color: #4b00ff;
            }
            i {
                padding-right: 5px;
            }
            &.trash {
                color: rgb(253, 44, 44);

                &:hover {
                    background:#fc572e;
                    color: white;
                }
            }
        }
    }
}

/* Image slider styles */
.images {
    display: flex;
    position: relative;
    max-width: 100%;
    max-height: 300px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;

    .slide-direction {
        width: 50px;

        .rectangle {
            display: flex;
            vertical-align: middle;
            align-self: center;
            width: 100%;
            height: 100px;
            background: rgba(0, 0, 0, 0.75);
            transition: .5s ease;
            opacity: .5;
        }
        .rectangle:hover {
            user-select: none;
            opacity: 1;

            svg {
                fill: rgba(255, 255, 255, 0.6);
                transition: .5s ease;
            }
        }
    }
    .slider {
        display: inline-block;
        position: relative;
        margin: 0 5px 0 5px;
        height: 300px;
        width: 40%;
        overflow: hidden;
        border: 1px solid var(--content-images-border-color);
        border-radius: 10px;
        transition: height 0.3s ease;

        .image-area {
            position: absolute;
            left: 0px;
            transition: left .2s ease;
            display: flex;
            gap: 5px;
            align-items: center;
            flex-wrap: nowrap;

            .image {
                display: inline-block;
                position: relative;
                max-width: 200px;
                max-height: 300px;
                transition: 
                        max-width 0.5s ease-out,
                        opacity 0.5s ease-out;

                img {
                    display: inline;
                    max-width: 200px;
                    max-height: 300px;
                }

                .image-cross {
                    position: absolute;
                    right: 5px;
                    top: 5px;
                    width: 8px;
                    cursor: pointer;
                    z-index: 10;
                    
                    &:hover {
                        transform: scale(1.2);
                        fill: #ff4545;
                        filter: drop-shadow(0 0 0.5px #ff4545);
                    }
                }
            }
        }
    }
    .editor {
        position: absolute;
        right: calc(50% - 20% - 5px - 10px);
        top: 5px;
        width: 8px;
        cursor: pointer;
        z-index: 20;
        
        &:hover {
            transform: scale(1.2);
            fill: #ff4545;
        }
    }
    .cross {
        position: absolute;
        right: calc(50% - 20% - 5px - 10px - 15px);
        top: 5px;
        width: 8px;
        cursor: pointer;
        z-index: 20;
        
        &:hover {
            transform: scale(1.2);
            fill: #ff4545;
        }
    }
}

/* authorization form */
.auth-page,
.reg-page {
    margin-top: 20px;

    p {
        margin: 0;
    }

    .title p {
        font-size: 26px;
        font-weight: 700;
        margin-bottom: 10px;
    }
    .switch-link p {
        font-size: 14px;

        a {
            text-decoration: none;
            font-weight: 600;
            color: var(--link-color);
        }
    }

    form {
        max-width: 350px;
        margin-top: 10px;
        font-size: 18px;

        .form-field {
            display: block;
            width: 100%;
            margin-bottom: 15px;

            .label {
                display: block;
                width: 100%;
            }
            input {
                display: block;
                width: 100%;
                border: var(--border-color) 1px solid;
                border-radius: 4px;
                outline: none;
                padding-left: 6px;
                padding-right: 6px;
            }
            .error {
                display: none;
                color: rgb(212, 58, 58);
            }
        }

        button {
            padding: 8px 25px;
            margin-top: 5px;
            margin-left: 10px;
            border: 0;
            border-radius: 8px;
            cursor: pointer;
            box-shadow: rgba(0, 0, 0, 0.043) 0px 3.39329px 6.36242px 0px;
            transition: box-shadow 0.1s ease-in-out;
            height: 42px;
            width: 120px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            
            background-color: rgb(108, 220, 215);

            &:hover {
                font-weight: 700;
                box-shadow: rgba(0, 0, 0, 0.094) 0px 7.5px 15px 0px;
                border: 2px solid rgb(108, 220, 215);
                color: #059e85;
                background-color: rgb(236, 236, 236);
            }
        }
    }
}
