@import "../utils";

.rio-calendar {
    pointer-events: auto;
    @include center-content;

    // Disable text selection, as that changes the cursor and is generally
    // annoying in this context
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.rio-calendar-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rio-calendar-header {
    display: flex;
    flex-direction: row;
    gap: 0.2rem;
    flex: 0;

    & > :nth-child(3) {
        pointer-events: none;

        display: flex;
        justify-content: center;
        align-items: center;

        flex-grow: 1;
    }
}

.rio-calendar-button {
    position: relative;
    width: 1.6rem;
    height: 1.6rem;

    color: var(--rio-local-text-color);
}
.rio-calendar:not(.rio-disabled-input) .rio-calendar-button {
    cursor: pointer;

    &:hover {
        color: var(--rio-local-level-2-bg);
    }

    &:hover::after {
        content: "";
        position: absolute;

        left: 0;
        top: 0;
        right: 0;
        bottom: 0;

        background: var(--rio-local-level-2-bg);
        border-radius: $infinite-corner-radius;
        opacity: 0.1;
    }
}

.rio-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1.8rem);
    grid-template-rows: repeat(7, 1.8rem);
    gap: 0.5rem;
}

.rio-calendar-day-name {
    font-weight: bold;
    text-align: center;
}

.rio-calendar-day {
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;
}
.rio-calendar:not(.rio-disabled-input) .rio-calendar-day {
    cursor: pointer;

    &:hover::after {
        content: "";
        position: absolute;

        left: 0;
        top: 0;
        right: 0;
        bottom: 0;

        background: var(--rio-local-text-color);
        border-radius: $infinite-corner-radius;
        opacity: 0.1;
    }
}

.rio-calendar-day-other-month {
    opacity: 0.4;
}

.rio-calendar-selected-day {
    font-weight: bold;

    color: var(--rio-local-level-2-fg);

    background: var(--rio-local-level-2-bg);
    border-radius: $infinite-corner-radius;
}
.rio-calendar.rio-disabled-input .rio-calendar-selected-day {
    color: var(--rio-local-fg);
    background: var(--rio-local-bg);
}
