@import "../../styles/config";

.clock-face {
    width: 290px;
    height: 290px;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background-color: $clock-face-background-color;
    @supports (background-color: var(--clock-face-background-color)) {
        background-color: var(--clock-face-background-color);
    }
    &__inner {
        position: absolute;
    }
}

.clock-face__container {
    margin-left: -2px;
}

.clock-face__number {
    position: absolute;
    transform-origin: 0 100%;
    width: 50px;
    text-align: center;
    z-index: 2;
    &--outer {
        height: calc(290px / 2 - 20px);
        > span {
            font-size: 16px;
            color: $clock-face-time-inactive-color;
            @supports (color: var(--clock-face-time-inactive-color)) {
                color: var(--clock-face-time-inactive-color);
            }
        }
    }
    &--inner {
        > span {
            font-size: 14px;
            color: $clock-face-inner-time-inactive-color;
            @supports (color: var(--clock-face-inner-time-inactive-color)) {
                color: var(--clock-face-inner-time-inactive-color);
            }
        }
    }
    > span {
        user-select: none;
        width: 30px;
        height: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: auto;
        border-radius: 50%;
        font-weight: 500;
        font-family: $primary-font-family;
        @supports (font-family: var(--primary-font-family)) {
            font-family: var(--primary-font-family)
        }
        &.active {
            background-color: $clock-hand-color;
            color: $clock-face-time-active-color;
            @supports (background-color: var(--clock-hand-color)) {
                background-color: var(--clock-hand-color);
                color: var(--clock-face-time-active-color);
            }
        }
        &.disabled {
            color: $clock-face-time-disabled-color;
            @supports (color: var(--clock-face-time-disabled-color)) {
                color: var(--clock-face-time-disabled-color);
            }
        }
    }
}

.clock-face__clock-hand {
    height: 103px;
    width: 2px;
    transform-origin: 0 100%;
    position: absolute;
    top: calc(50% - 103px);
    z-index: 1;
    background-color: $clock-hand-color;
    @supports (background-color: var(--clock-hand-color)) {
        background-color: var(--clock-hand-color);
    }
    &:after {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background-color: inherit;
        position: absolute;
        bottom: -3px;
        left: -3.5px;
    }
}

.clock-face__clock-hand_minute:before {
    content: '';
    width: 7px;
    height: 7px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    left: calc(50% - 8px);
    box-sizing: content-box;
    border-width: 4px;
    border-style: solid;
    border-color: $clock-hand-color;
    @supports (border-color: var(--clock-hand-color)) {
        border-color: var(--clock-hand-color);
    }
}

@media (max-device-width: 1023px) and (orientation: landscape) {
    .clock-face {
        width: 225px;
        height: 225px;
        padding: 5px;
    }
    .clock-face__number {
        &--outer {
            height: calc(225px / 2 - 5px);
        }
    }

    .clock-face__clock-hand_minute:before {
        top: 0;
    }
}
