:root {
    --main-color: #69a2b0;
    --secondary-color: #1c375c;
    --background-shadow: rgba(59, 151, 217, 0.2); 
    --font-color: #191716;
    --link-color: #025c9e;
    --border-color: rgba(242, 242, 242, 0.75);
}

.calendar-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    margin: auto;
    background: linear-gradient(135deg, #ff7e6, #f7f1e1);
    padding: 0 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    overflow: hidden;
}

.calendar-slot {
    position: relative;
    flex: 1;
    border: 0.1px solid rgba(247, 247,247, 0.5);
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 12px;
    background-color: #fcfcfc;
}

.calendar-slot.calendar-slot-today-first {
    border-left: 2px solid gray;
}

.calendar-slot.calendar-slot-today-last {
    border-right: 2px solid gray;
}

.calendar-slot.calendar-slot-selected {
    border-top: 2px solid gray;
    border-bottom: 2px solid gray;
}

.calendar-slot.calendar-slot-weekend {
    background-color: #EEF;
}

.calendar-slot.calendar-slot-today {
    background-color: #CFF;
}

.calendar-slot.calendar-slot-has-entries {
    background-color: #ABC;
}

.calendar-slot.calendar-slot-booked.workorder-cancelled{
    background-color: #DDD;
}

.calendar-slot.calendar-slot-booked {
    background-color: #DD4;
}

.calendar-slot.calendar-slot-overbooked {
    background-color: #F66;
}

.calendar-slot.calendar-slot-booked.workorder-finished {
    background-color: #4D4;
}

.calendar-slot a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--font-color);
    background: none;
    text-decoration: inherit;
    z-index: 1;
}

.calendar-slot a:hover {
    color: #000;
    background: rgba(80, 120, 255, 0.5);
}

.calendar {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.calendar-head {
    display: flex;
    flex-direction: column;
}

.calendar-head-row {
    display: flex;
    justify-content: space-between;
    background-color: rgba(84, 180, 211, 0.3);
    border-bottom: 1px solid rgba(85,85,85,.3);
}

.calendar-head.cal-week {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    box-sizing: border-box;
    margin: auto;
    padding: 0 10px;
    overflow: hidden;
}

.calendar-head-row.cal-day, .calendar-head-row.cal-weekday {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    box-sizing: border-box;
    height: 2.2em;
    width: 100%;
    margin: auto;
    padding: 0 10px;
    overflow: hidden;
}

.calendar-head-row i {
    color: #fff;
}

.calendar-head-row > div:nth-child(odd) {
    background-color: rgb(247, 247, 247);
    padding: 0.5em;
}

.calendar-head-row > div:nth-child(even) {
    padding: 0.5em;
}

.calendar-head-row > div:only-child {
    background-color: rgb(25,110, 255);
    padding: 0.5em;
    color: #fff;
}

.current-date {
    background-color: rgb(25,110,255);
    color: #fff;
}

.calendar-body-row {
    display: flex;
    height: 2.2em;
    border-bottom: 1px solid rgba(85,85,85,.3);
}

.calendar-body-row > * > span {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    margin: auto;
    box-sizing: border-box;
    z-index:1;
    position: relative;
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 0 3px black;
    top: 0.5em;
    overflow: hidden;
}

#title {
    text-align: left;
    background-color: rgb(0, 82, 133);
    padding: 0.3em;
}

/*.calendar-body-row > div:nth-child(odd) {
    background-color: rgb(180, 200, 180);
}*/

.calendar-body-row-overlay {
    position: relative;
    top: -2em;
    margin-bottom: -2em;
    text-align: left;
    height: 2em;
}

.calendar-body-row-overlay > div {
    position: absolute;
    display: inline-block;
    box-shadow: 0 0 3px black inset;
}

.calendar-overlay-note {
    background-color: rgba(0, 0, 255, 0.5);/*rgba(120, 120, 80, 0.5);*/
}

.calendar-overlay-metering {
    background-color: rgba(255, 0, 0, 0.5);/*rgba(120, 120, 80, 0.5);*/
}

.calendar-overlay-connection_project_metering {
    background-color: rgba(255, 0, 0, 0.5);/*rgba(120, 120, 80, 0.5);*/
}

.calendar-overlay-vacation {
    background-color: rgba(0, 255, 0, 0.5);/*rgba(120, 120, 80, 0.5);*/
}


/*Calendar grid */
.month-calendar-body {
    display: grid;
    grid-template-columns: 30px repeat(7, minmax(0, 1fr));
}

/* Cell unit */
.month-calendar-cell {
    display: flex;
    flex-direction: column;
    line-height: 1;
    padding: 3px;
    height: 120px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    border-radius: 0.5px;
    position: relative;
    z-index: 1;
}

.month-calendar-cell {
    transition: transform 0.2s ease;
    transform-origin: center;
}

.month-calendar-cell:hover {
    transform: scale(1.1);
    position: relative;
    z-index: 10;
    background-color: #fff;
}

.month-calendar-cell a {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    overflow-wrap: anywhere;
    z-index: 40;
    color: #073763;
}

.month-calendar-cell a:hover {
    color: #073763;
    text-decoration: underline;
}

.pointer {
    cursor:pointer;
}

.month-calendar-cell-day {
    margin-top:auto;
    text-align:right;
}

.month-calendar-cell.today {
    background-color: #fff2cc;
    color: #000;
}

.month-calendar-cell.selected {
    border: 2px solid #0d6efd;
    border-radius: 2px;
}

.month-calendar-cell.cell-available {
    background-color: #d9ead3;
}

.month-calendar-cell.cell-booked {
    background-color: #8e7cc3;
}

.month-calendar-cell.cell-booked a {
    color: #fff;
}

.month-calendar-cell.cell-unavailable {
    background: linear-gradient(
    to right top,
    #e9ecef 0%,
    #e9ecef 35%,
    #f5f5f5 65%,
    #f5f5f5 100%
    );
}

.cell-outside-month {
    color:#999;
}

.month-calendar-label {
    font-weight: bold;
    padding-right: 3px;
    text-align: right;
    color: #444444;
}

.month-calendar-label.weekend {
    color: #e06666;
}

/*Typography and bar elements*/
.calendar-header-left {
    background-color: var(--background-shadow);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.calendar-header-right {
    float:right;
    background-color:#E1F4FE;
    padding:5px;
}

.calendar-chevrons {
    padding-left:20px;
}
.calendar-name {
    padding-left:20px;
}

.calendar-title {
    text-align: center;
    background-color: var(--secondary-color);
    font-size: clamp(2.2rem 2vw 2rem);
    line-height: 1.1;
    padding: 1rem;
    border-radius: 0.5rem;
}

.calendar-title h1 {
    color: #fff;
}

.calendar-header span {
    font-size: clamp(1.1rem 1.5vw 1rem);
    color: var(--font-color);
    font-weight: 400;
}

.calendar-header span a {
    color: var(--link-color);
    font-weight: 400;
}

.calendar-header span a:hover,
.calendar-header span a:focus {
    color: var(--font-color);
}

.calendar-sidebar {
    margin-top: 1rem;
}

.cal-hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(2, 0, 36, 1),rgba(9, 9, 121, 1),rgba(0, 212, 255, 1));
}

/*Tables*/
.calendar-tr {
    background-color: #cfe2f3;
}

.reservation-list {
    padding: 1rem;
}

#CalendarReservations {
    padding: 1rem;
}

/*Reservation and dots*/
.installer-checks {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.installer-checks .form-check {
    white-space: nowrap;
}

.dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.large-dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.calendar-reservation {
    display: block;
    font-size: 0.65rem;
    line-height: 1.5;
    color: var(--font-color);
    z-index: 10;
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: font-size: 0.15s ease;
}

.calendar-reservation:hover {
    z-index: 100;
    font-size: 1rem;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}


/*Buttons*/
.calendar-today-button {
}

#cal-button {
    font-size: 0.9rem;
    margin: 0.1rem;
}

#cal-button-dg i{
    color: #d70022;
}

/*Responsivity*/
@media(max-width: 935px) {
    .calendar-sidebar {
        width: 100%;
        margin-bottom: 1rem;
    }

    .month-calendar-body {
        width: 100%;
    }
}

/*Adjust for Landscape mode */
@media (max-width: 992px) and (orientation: landscape) {
    .calendar-container {
        max-width: 90%;
        padding; 1.5em 1em;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 1);
    }
}

@media (max-width: 768px) {
    .installer-checks {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .calendar-sidebar .form-check {
        margin-bottom: 0;
    }

}


@media only screen and (max-width: 64em) {
    .calendar-head-row.cal-week {
        grid-template-columns: repeat(auto-fit, minmax(150px 1fr));
        padding: 0 8px;
    }
    .calendar-head-row.cal-day {
        grid-template-columns: repeat(auto-fit, minmax(2px, 1fr));
        padding: 0 5px;
    }
    .calendar-head-row.cal-weekday {
        grid-template-columns: repeat(auto-fit, minmax(2px, 1fr));
        padding: 0 4px;
    }
}

@media only screen and (max-width: 60em) {
    .calendar-head-row.cal-week {
        grid-template-columns: repeat(auto-fit, minmax(50px 1fr));
        padding: 0 8px;
    }
    .calendar-head-row.cal-day {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 2px;
    }
    .calendar-head-row.cal-weekday {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 1px;
    }
    .calendar-body-row > * > span {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 1px;
    }
    .month-calendar-cell a {
        width: 95%;
        max-width: 95%;
        text-align: center;
        line-height: 1.2;
    }
}

@media only screen and (max-width: 41em) {
    .calendar-head-row.cal-week {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 6px;
    }
    .calendar-head-row.cal-day {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 1px;
    }
    .calendar-head-row.cal-weekday {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 1px;
    }
    .calendar-body-row > * > span {
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        padding: 0 1px;
    }
}
