/* =========================================================
   HESK 3 - Planned Visits Calendar
   ========================================================= */

.hesk-calendar {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 25px;
    padding: 20px;
    box-sizing: border-box;

    background: #ffffff;
    border: 1px solid #e3e7eb;
    border-radius: 12px;

    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
}

.hesk-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.hesk-calendar-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #263238;
}

.hesk-calendar-navigation {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hesk-calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 38px;
    height: 38px;
    padding: 0 12px;

    border: 1px solid #d9dee3;
    border-radius: 7px;

    background: #fff;
    color: #37474f;

    cursor: pointer;
    font-size: 14px;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}

.hesk-calendar-btn:hover {
    background: #f2f6f8;
    border-color: #b8c4cb;
}

.hesk-calendar-btn-primary {
    background: #1976d2;
    color: #fff;
    border-color: #1976d2;
}

.hesk-calendar-btn-primary:hover {
    background: #1565c0;
    border-color: #1565c0;
}

.hesk-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.hesk-calendar-weekday {
    padding: 8px 4px;
    text-align: center;

    color: #78909c;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.hesk-calendar-day {
    position: relative;

    min-height: 70px;
    padding: 8px;

    background: #fafbfc;
    border: 1px solid #edf0f2;
    border-radius: 8px;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

.hesk-calendar-day:hover {
    background: #f3f7fa;
    border-color: #cfd8dc;
}

.hesk-calendar-day-empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.hesk-calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    color: #37474f;
    font-size: 13px;
    font-weight: 500;

    border-radius: 50%;
}

.hesk-calendar-day-today .hesk-calendar-day-number {
    background: #1976d2;
    color: #fff;
    font-weight: 700;
}

.hesk-calendar-day-has-event .hesk-calendar-day-number {
    border: 2px solid #ef5350;
    font-weight: 800;
}

.hesk-calendar-day-today.hesk-calendar-day-has-event
.hesk-calendar-day-number {
    background: #1976d2;
    border-color: #ef5350;
}

.hesk-calendar-events {
    margin-top: 6px;
}

.hesk-calendar-event {
    display: block;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    padding: 3px 6px;
    margin-bottom: 3px;

    border-radius: 4px;

    background: color-mix(in srgb, var(--hesk-calendar-event-color, var(--primary)) 14%, var(--surface));
    color: var(--hesk-calendar-event-color, var(--primary));

    font-size: 11px;
    font-weight: 600;
}

.hesk-calendar-event-time {
    margin-right: 3px;
    font-weight: 800;
}

.hesk-calendar-legend {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-top: 15px;

    color: #78909c;
    font-size: 12px;
}

.hesk-calendar-legend-dot {
    display: inline-block;

    width: 9px;
    height: 9px;

    margin-right: 5px;

    border: 2px solid #ef5350;
    border-radius: 50%;
}

/* Modal */

.hesk-calendar-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

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

    padding: 20px;

    background: rgba(15, 23, 42, .55);
}

.hesk-calendar-modal.is-open {
    display: flex;
}

.hesk-calendar-modal-box {
    width: 100%;
    max-width: 520px;

    background: #fff;
    border-radius: 12px;

    box-shadow: 0 15px 50px rgba(0, 0, 0, .25);

    overflow: hidden;
}

.hesk-calendar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;

    border-bottom: 1px solid #eceff1;
}

.hesk-calendar-modal-title {
    margin: 0;

    color: #263238;
    font-size: 18px;
    font-weight: 700;
}

.hesk-calendar-modal-close {
    border: 0;
    background: transparent;

    color: #78909c;

    font-size: 24px;
    cursor: pointer;
}

.hesk-calendar-modal-body {
    padding: 20px;
}

.hesk-calendar-form-group {
    margin-bottom: 15px;
}

.hesk-calendar-form-group label {
    display: block;

    margin-bottom: 6px;

    color: #455a64;
    font-size: 13px;
    font-weight: 700;
}

.hesk-calendar-form-control {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 12px;

    border: 1px solid #cfd8dc;
    border-radius: 6px;

    background: #fff;
    color: #263238;

    font-size: 14px;

    outline: none;
}

.hesk-calendar-form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, .12);
}

textarea.hesk-calendar-form-control {
    min-height: 90px;
    resize: vertical;
}

.hesk-calendar-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    padding: 15px 20px;

    border-top: 1px solid #eceff1;
}

/* Visit list */

.hesk-calendar-visit-list {
    margin: 0;
    padding: 0;

    list-style: none;
}

.hesk-calendar-visit {
    padding: 12px;

    margin-bottom: 8px;

    border: 1px solid #e0e0e0;
    border-radius: 8px;

    background: #fafafa;
}

.hesk-calendar-visit-title {
    color: #263238;
    font-weight: 700;
}

.hesk-calendar-visit-time {
    color: #1976d2;
    font-weight: 700;
}

.hesk-calendar-visit-description {
    margin-top: 5px;

    color: #607d8b;
    font-size: 13px;
}

.hesk-calendar-loading {
    padding: 25px;
    text-align: center;

    color: #90a4ae;
}

/* Mobile */

@media (max-width: 700px) {

    .hesk-calendar {
        padding: 12px;
        border-radius: 8px;
    }

    .hesk-calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hesk-calendar-navigation {
        justify-content: space-between;
    }

    .hesk-calendar-grid {
        gap: 2px;
    }

    .hesk-calendar-day {
        min-height: 52px;
        padding: 4px;
        border-radius: 5px;
    }

    .hesk-calendar-day-number {
        width: 25px;
        height: 25px;
    }

    .hesk-calendar-event {
        display: none;
    }

    .hesk-calendar-day-has-event::after {
        content: "";

        position: absolute;
        right: 5px;
        bottom: 5px;

        width: 6px;
        height: 6px;

        background: #ef5350;
        border-radius: 50%;
    }

    .hesk-calendar-weekday {
        font-size: 10px;
    }
}
