@import url('./colors.css');
@import url('./fonts.css');
@import url('./variables.css');

html {
    height: 100svh;
}

p, h1, h2, h3, h4, h5, h6, h7 {
    margin: 0;
}

p, h1, h2, h3, h4, h5, h6, h7 {
    font-weight: 500;
}

a {
    text-decoration: none;
}

button {
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
}

.custom-filter-wrapper {
    position: relative;
    user-select: none;

    .custom-select {
        position: relative;
        width: 200px;
        cursor: pointer;

        .custom-select-trigger {
            position: relative;
            background: #dfdfdf;
            padding: 10px 20px;
            border: 1px solid #ccc;
            border-radius: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
    
            &::after {
                position: absolute;
                top: 9px;
                right: 10px;
                content: url('../assets/jackdaw.svg');
                transition: all var(--transition-select-jackdaw);
            }
        }

        &.open {
            .custom-select-trigger::after {
                transform: rotate(-180deg);
            }

            .custom-options {
                max-height: 250px;
                opacity: 1;
            }
        }
    }
    
    .custom-options {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background-select-color);
        border: 1px solid #ccc;
        border-top: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        overflow: scroll;
        max-height: 0;
        opacity: 0;
        transition: all 0.3s ease-in-out;
        z-index: 10;
    }
    
    .custom-option {
        display: block;
        padding: 10px 20px;
        cursor: pointer;
        transition: all var(--transition-select);

        &:hover {
            background: var(--primary-color__hover);
        }

        &:active {
            background: var(--primary-color__active);
        }
    }   
}

.custom-checkbox {
  display: inline-block;
  position: relative;
  padding: 2px 0 0 27px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;

  input {
    display: none;

    ~ .checkmark::after {
        margin: 4px 0 0 4px;
        width: 10px;
        height: 5px;
        border: 2px solid var(--primary-color);
        border-width: 2px 2px 0 0;
        opacity: 0;
        transform: rotate(135deg);
        /* transition: opacity var(--transition-checkbox); */
        content: "";
    }

    &:checked ~ .checkmark::after {
        display: block;
        opacity: 1;
        /* transform: rotate(180deg); */
    }
  }

  .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: var(--background-checkbox-color);
    border-radius: 3px;
  }
}

ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

a {
    color: var(--primary-color);
    transition: all var(--transition-button__hover);
    cursor: pointer;

    &:hover {
        color: var(--primary-color__hover);
    }

    &:active {
        color: var(--primary-color__active);
        transition: all var(--transition-button__active);
    }
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0 160px 50px;
    background: var(--background-main);
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;

    header {
        width: 100%;
        height: 100px;
        padding: 24px 75px 24px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--background-header-color);
        border: 1px solid var(--main-border-color);
        border-width: 0 1px 1px;
        border-radius: 0 0 48px 48px;
        box-shadow: var(--primary-shadow);
        box-sizing: border-box;
        z-index: 100;

        #mobile-menu, #filters-menu, #filters, #burger-menu {
            display: none;
        }

        #logo {
            width: 250px;
            height: 52px;
        }

        nav ul {
            display: flex;
            gap: 80px;

            li {
                display: flex;
                justify-content: center;
                align-items: center;

                a {
                    text-wrap: nowrap;
                    color: var(--text-base-color);

                    &.selected {
                        color: var(--text-menu-color);
                        font-weight: var(--font-weight-extrabold);
                    }
                }
            }
        }

        #languages {
            height: 24px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        #languages a, #mobile-languages a {
            width: 24px;
            line-height: 24px;
            text-align: center;
            color: var(--text-base-color);
            transition-duration: 100ms;
            cursor: pointer;

            &:hover {
                font-size: 15px;
                color: var(--primary-color__hover) !important;
            }

            &:active {
                color: var(--primary-color__active) !important;
            }

            &.selected {
                color: var(--text-menu-color) !important;
                font-weight: var(--font-weight-extrabold);
            }
        }

        #burder-menu {
            display: none;
            /* width: 12px;
            height: 8px; */
        }
    }

    main {
        display: flex;
        flex-direction: column;
        gap: 30px;
        margin-top: 50px;

        .main-input {
            /* height: 44px; */
            padding: 12px;
            font-size: 14px;
            line-height: 20px;
            border: 1px solid var(--main-border-color);
            border-radius: var(--border-radius-normal);
            transition: all var(--transition-input);

            &:hover {
                border: 1px solid var(--primary-color__hover);
            }

            &:focus {
                border: 1px solid var(--primary-color__active) !important;
                outline: none;
            }
        }
    }

    .card {
        padding: 20px 32px;
        border: 1px solid var(--main-border-color);
        border-radius: 25px;
        box-shadow: -1px -1px 15px rgba(66, 165, 245, 0.15);
    }

    .main-table {
        display: block;
        max-width: 100%;
        overflow: auto;
        border: 1px solid var(--main-border-color);

        thead, tbody {
            width: 100%;
            display: block;

            tr {
                width: max-content;
                display: block;

                th, td {
                    text-align: left;
                    word-wrap: break-word;
                    padding: 0;

                    &:not(:first-child) {
                        padding-left: 30px;
                    }
                }
            }

        }

        thead {
            width: 100%;
            position: sticky;
            top: 0;
            left: 0;
            overflow: auto;
            z-index: 1;

            tr {
                max-height: 60px;
                padding: 20px;
                    background: var(--background-header-color);

                th {
                    color: var(--text-header-color);
                    font-size: 13px;
                    font-weight: 600;
                    line-height: 20px;

                    a {
                        &.selected {
                            color: var(--text-menu-color);
                        }
                    }
                }
            }
        }

        tbody {
            max-height: 60svh;

            tr {
                td {
                    color: var(--text-table-color);
                    font-size: 15px;
                    font-weight: 500;
                    line-height: 24px;

                    @media screen and (max-width: 900px) {
                        font-size: 12px;
                        line-height: 20px;
                    }
                }

                &:nth-child(odd) {
                    background: var(--table-row-basic);
                }

                &:nth-child(even) {
                    background: var(--table-row);
                }
            }

            .table-footer {
                width: 100%;

                > td {
                    max-width: 100% !important;
                    min-width: 100% !important;
                    padding-top: 10px;
                    background: var(--background-header-color);
                }
            }
        }
    }

    .main-filter {
        width: 300px;
        /* position: sticky !important; */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;

        p {
            color: var(--text-menu-color);
            font-size: 16px;
            font-weight: 600;
            line-height: 20px;
        }

        ul {
            max-width: 300px;
            min-width: 300px;
            background: var(--table-row);
            border: 1px solid var(--main-border-color);
            border-radius: 7px;

            li {
                box-sizing: border-box;
                padding: 5px;
                color: var(--text-base-color);
                font-size: 14px;
                font-weight: 400;
                line-height: 20px;
                text-align: center;
                cursor: pointer;
                transition: all var(--transition-button__hover);

                a {
                            color: var(--text-base-color);
                }

                &:first-child {
                    border-radius: 7px 7px 0 0;
                }

                &:last-child {
                    border-radius: 0 0 7px 7px;
                }

                &:hover {
                    color: var(--text-menu-color);
                }

                &:active {
                    color: var(--primary-color__active);
                }

                &:active, &.selected {
                    background: var(--primary-color);
                    color: var(--text-base-color);
                }
            }
        }
    }

    .table-filters {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .inline-filter {
        min-height: 46px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 20px;

        @media screen and (max-width: 900px) {
            flex-direction: column;
            align-items: flex-start;
            flex-wrap: nowrap;

            p {
                text-align: left;
            }

            .main-input {
                max-width: 200px;
            }
        }
    }

    .chips-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 20px;

        .chip {
            width: 110px;
            height: 34px;
            display: flex;
            justify-content: center;
            align-items: center;
            border: 2px solid var(--table-row);
            border-radius: 7px;
            box-sizing: border-box;
            cursor: pointer;
            transition: all var(--transition-button__hover);

            p { 
                padding: 5px 0;
                font-size: 13px;
                font-weight: 400;
                line-height: 20px;
            }

            &.selected {
                background: var(--primary-color);
                border: 1px solid var(--main-border-color);

                p {
                    font-weight: 600;
                }
            }

            &.wide {
                width: unset;
                min-width: 50px;
                padding-left: 10px;
                padding-right: 10px;
            }

            &:hover {
                background: var(--primary-color__hover);
            }

            &:active {
            transition: all var(--transition-button__active);
                background: var(--primary-color__active);
            }

            &:first-child {
                p {
                    font-weight: 600;
                }
            }
        }

        @media screen and (max-width: 600px) {
            justify-content: center;
        }
    }

    button {
        padding: 16px 36px;
        background: transparent;
        border-radius: 10px;
        border: none;
        color: var(--text-inverted-color);
        transition: all var(--transition-button__hover);

        &.outline-button {
            color: var(--text-base-color);
            box-shadow: 0 0 0 1px var(--primary-color);
        }

        &.xs {
            padding: 0px 16px;
        }

        &.sm {
            padding: 5px 32px;
        }

        &.md {
            padding: 8px 40px;
        }

        &:hover {
            color: var(--text-inverted-color);
            background: var(--primary-color__hover);
        }

        &:active {
            color: var(--text-inverted-color);
            background: var(--primary-color__active);
            transition: all var(--transition-button__active);
        }
    }

    .close-button {
        position: absolute;
        top: 12px;
        right: 12px;
        padding: 4px;

        &:hover {
            color: inherit;
            background: transparent;
        }

        &:active {
            color: inherit;
            background: transparent;
        }
    }

    @media screen and (max-width: 1440px) {
        header {
            padding: 24px 40px 24px 20px;

            nav ul {
                gap: 30px;
            }
        }
    }

    @media screen and (max-width: 1300px) {
        padding: 0 20px 30px;

        h1, h2, h3, h4, h5, h6, h7, p, span {
            text-align: center;
        }

        main {
            margin-top: 110px;
        }

        header {
            position: fixed;
            top: 0;
            left: 0;
            height: 80px;
            padding: 0 20px;
            justify-content: space-between;
            border-radius: 0;

            #mobile-menu, #filters-menu, #filters, #burger-menu {
                display: block;
            }

            #mobile-menu, #filters-menu {
                position: absolute;
                top: 0;
                left: 0;
                width: 100svw !important;
                height: 100svh;
                background: var(--background-main-color);
                transition: all var(--transition-menu);
            }

            #mobile-menu {
                transform: translateX(101vw);
                overflow-y: auto;
    
                h1 {
                    padding: 40px;
                }
    
                nav ul {
                    padding: 40px;
                    display: flex;
                    flex-direction: column;
                }

                #mobile-languages {
                    width: 100%;
                    display: flex;
                    justify-content: center;

                    p {
                        line-height: 24px;
                    }
                }
            }
    
            #filters-menu {
                transform: translateX(-101vw);
                overflow-y: auto;
    
                .filters {
                    padding: 40px;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    gap: 15px;
                }
            }
    
            > .open {
                transform: translateX(0) !important;
    
            }

            #logo {
                margin-right: 60px;
            }

            > nav {
                display: none;
            }

            #languages {
                display: none;
            }

            #burder-menu {
                display: block;
            }
        }

        body {
            padding: 0 10px 30px;
        }
    }

    @media screen and (max-width: 600px) {
        header {
            > button {
                padding: 5px 32px !important;
            }

            #logo {
                width: 150px;
                height: 37px;
                margin-right: 30px;
            }
        }
    }
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: var(--background-main-color);
}

*::-webkit-scrollbar-thumb {
    background: #bbdefb;
    background-clip: content-box;
    border: var(--text-base-color);
    border-radius: 20px;
}

.smallest {
    font-size: x-small; 
    color: #8caddc;
}

.hidden {
    display: none !important;
}

.fancybox__caption {
	max-height: 30vh;
	overflow-y: auto;
}

