﻿@import "../../../Styles/functions.scss";
@import "../../../Styles/media-queries.scss";

.bit-tpc {
    margin: 0;
    padding: 0;
    box-shadow: none;
    font-weight: 400;
    position: relative;
    box-sizing: border-box;
    font-size: spacing(2.25);
    font-family: $tg-font-family;

    &.bit-dis {
        .bit-tpc-lbl,
        .bit-tpc-tdv {
            color: $clr-fg-dis;
        }

        .bit-tpc-icn {
            cursor: default;
            pointer-events: none;
            color: $clr-fg-dis;
            background: none $clr-bg-dis;
            border: $shp-border-width $shp-border-style $clr-brd-dis;
        }

        .bit-tpc-ico {
            cursor: default;
            color: $clr-fg-dis;
        }

        .bit-tpc-inp {
            cursor: default;
            color: $clr-fg-dis;
            background: none $clr-bg-dis;
        }
    }

    &.bit-inv {
        .bit-tpc-icn {
            border-color: $clr-err;
        }
    }

    &.bit-rtl {
        .bit-tpc-cbn {
            left: 0;
            right: unset;
        }
    }
}

.bit-tpc-lbl {
    margin: 0;
    display: block;
    box-shadow: none;
    font-weight: 600;
    box-sizing: border-box;
    padding: spacing(0.5) 0;
    font-size: spacing(1.75);
    overflow-wrap: break-word;
    color: $clr-fg-pri;
}

.bit-tpc-wrp {
    position: relative;
}

.bit-tpc-icn {
    margin: 0;
    display: flex;
    cursor: pointer;
    box-shadow: none;
    height: spacing(4);
    position: relative;
    align-items: center;
    flex-flow: row nowrap;
    padding: 0 spacing(1);
    box-sizing: border-box;
    border-radius: $shp-border-radius;
    background-color: $clr-bg-pri;
    border: $shp-border-width $shp-border-style $clr-brd-pri;
}

.bit-tpc-ico {
    cursor: pointer;
    color: $clr-fg-sec;
    padding-inline-end: 0;
    padding-inline-start: spacing(1);
}

.bit-tpc-inp {
    margin: 0;
    outline: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    height: 100%;
    border: none;
    cursor: pointer;
    box-shadow: none;
    font-weight: 400;
    border-radius: 0;
    box-sizing: border-box;
    text-overflow: ellipsis;
    font-size: spacing(1.75);
    background: none transparent;
    color: $clr-fg-pri;
    font-family: $tg-font-family;
}

.bit-tpc-ein {
    cursor: default;
}

.bit-tpc-lic {
    .bit-tpc-icn {
        flex-direction: row-reverse;
    }

    .bit-tpc-ico {
        padding-left: 0;
        padding-right: spacing(1);
    }
}

.bit-tpc-foc {
    .bit-tpc-icn::after {
        content: "";
        position: absolute;
        pointer-events: none;
        inset: spacing(-0.125);
        border-radius: $shp-border-radius;
        border: spacing(0.25) $shp-border-style $clr-pri;
    }
}

.bit-tpc-und {
    .bit-tpc-wrp {
        width: 100%;
        display: flex;
        border-bottom: $shp-border-width $shp-border-style $clr-brd-pri;
    }

    .bit-tpc-icn {
        border: none;
        flex: 1 1 0px;
        text-align: left;
    }

    &.bit-dis {
        .bit-tpc-wrp {
            border-bottom-color: $clr-brd-dis;
        }
    }

    &.bit-tpc-foc {
        .bit-tpc-icn::after {
            border: none;
            border-radius: 0;
            border-bottom: spacing(0.25) $shp-border-style $clr-brd-pri;
        }
    }
}

.bit-tpc-nbd {
    .bit-tpc-icn {
        border: none;
    }
}

.bit-tpc-ovl {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    position: fixed;
    z-index: $zindex-overlay;
    background-color: transparent;
}

.bit-tpc-cal {
    display: none;
    position: fixed;
    font-weight: 400;
    outline: transparent;
    box-sizing: border-box;
    z-index: $zindex-callout;
    font-size: spacing(1.75);
    animation-fill-mode: both;
    animation-duration: 0.367s;
    font-family: $tg-font-family;
    box-shadow: $box-shadow-callout;
    border-radius: $shp-border-radius;
    animation-name: bit-fade-show, bit-slide-down;
    animation-timing-function: cubic-bezier(0.1, 0.9, 0.2, 1);
}

.bit-tpc-cac {
    margin: 0;
    height: 100%;
    display: flex;
    outline: none;
    box-shadow: none;
    position: relative;
    align-items: center;
    overflow: hidden auto;
    align-content: center;
    justify-content: center;
    border-radius: $shp-border-radius;
    background-color: $clr-bg-pri;
    padding: spacing(2);
    box-sizing: border-box;
}

.bit-tpc-tic {
    display: flex;
    direction: ltr;
    gap: spacing(1);
    flex-direction: row;
    justify-content: space-between;
}

.bit-tpc-tpr {
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
    justify-content: space-between;
    gap: spacing(0.25);
}

.bit-tpc-tdv {
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    font-size: spacing(2.5);
    font-weight: $tg-font-weight;
}

.bit-tpc-am-pm {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-inline-start: spacing(2);
    padding: spacing(1.6) 0;
}

.bit-tpc-tin {
    margin: 0;
    padding: 0;
    border: none;
    cursor: pointer;
    text-align: center;
    align-items: center;
    width: spacing(3.75);
    box-sizing: border-box;
    justify-content: center;
    -moz-appearance: textfield; // Firefox
    background-color: $clr-bg-pri;
    font-size: spacing(2.28);
    font-weight: $tg-font-weight;
    overflow: hidden;
    aspect-ratio: 1;

    &:disabled {
        cursor: default;
        color: $clr-fg-dis;
    }

    &::-webkit-inner-spin-button, // Chrome, Safari, Edge, Opera
    &::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    &:focus {
        border: none;
        border-bottom: $shp-border-width $shp-border-style $clr-brd-pri-active;
        outline: none;
    }
}

.bit-tpc-tbt {
    padding: 0;
    border: none;
    cursor: pointer;
    overflow: visible;
    position: relative;
    text-align: center;
    width: spacing(3.75);
    outline: transparent;
    line-height: spacing(3.75);
    font-size: spacing(1.5);
    background-color: transparent;
    color: $clr-fg-pri;
    border-radius: $shp-border-radius;
    aspect-ratio: 1;

    @media (hover: hover) {
        &:hover {
            background-color: $clr-bg-pri-hover;
        }
    }

    &:active {
        background-color: $clr-bg-pri-hover;
    }

    i {
        speak: none;
        width: 100%;
        display: flex;
        aspect-ratio: 1;
        align-items: center;
        justify-content: center;
    }

    &:disabled {
        color: $clr-fg-dis;
        pointer-events: none;
        background-color: transparent;

        i {
            color: $clr-fg-dis;
        }
    }
}

.bit-tpc-bam,
.bit-tpc-bpm {
    font-size: spacing(1.8);
    font-weight: $tg-font-weight;
}

.bit-tpc-bns {
    color: $clr-pri-text;
    background-color: $clr-pri;

    &:disabled {
        background-color: $clr-bg-dis;
    }

    @media (hover: hover) {
        &:hover {
            background-color: $clr-pri-hover;
        }
    }

    &:active {
        background-color: $clr-pri-active;
    }
}

.bit-tpc-cbn {
    top: 0;
    right: 0;
    display: none;
    aspect-ratio: 1;
    position: absolute;
    max-width: spacing(5);
}

.bit-tpc-sta {
    width: fit-content;

    .bit-tpc-cal {
        display: block;
        z-index: unset;
        animation: none;
        position: relative;
    }
}

.bit-tpc-req {
    .bit-tpc-lbl::after {
        content: "*";
        color: $clr-req;
        margin-inline-start: spacing(0.625);
    }
}

.bit-tpc-res {
    @include lt-sm {
        top: 0;
        left: 0;
        opacity: 0;
        width: 100%;
        display: block;
        overflow: hidden;
        animation-name: unset;
        transform: translateY(-100%);
        box-shadow: $box-shadow-callout;
        transition: transform 200ms ease-out, opacity 100ms linear;

        .bit-tpc-tdv {
            font-size: spacing(7);
        }

        .bit-tpc-tin {
            width: 100%;
            min-width: spacing(7);
            max-width: spacing(12);
            font-size: spacing(5);
        }

        .bit-tpc-tbt {
            width: 100%;
            min-width: spacing(7);
            max-width: spacing(12);
            font-size: spacing(3);
        }

        .bit-tpc-bam,
        .bit-tpc-bpm {
            width: 100%;
            font-size: spacing(4);
            margin: spacing(0.25);
        }

        .bit-tpc-cbn {
            display: block;
            max-width: spacing(5);
        }
    }
}
