@media(max-width:1200px) {
    *,
    *:before,
    *:after {
        box-sizing: border-box;
    }
    .calendar-container {
        overflow: hidden;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
        font-weight: 100;
        color: #7b7b7b;
        margin: 0;
        padding: 0;
        background: #fff;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
    }
    #calendar {
        transform: translate3d(0, 0, 0);
        width: 100%;
        margin: 0 auto;
        height: auto;
        overflow: hidden;
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
    }
    .header {
        padding: 40px 5px;
        width: 100%;
        background: #fff;
        text-align: center;
        position: relative;
        z-index: 100;
    }
    .header h1 {
        color: #e5112f;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
        margin: 0;
        padding: 0;
        line-height: 30px;
        font-weight: 100;
        letter-spacing: 1px;
        font-size: 30px;
    }
    .header-year {
        color: #7b7b7b;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
    }
    .left,
    .right {
        position: absolute;
        width: 50px;
        height: 50px;
        border-style: solid;
        top: 38%;
        margin-top: -7.5px;
        cursor: pointer;
    }
    .left {
        left: 9x;
        border-radius: 50%;
        border: 1px solid rgba(123, 123, 123, 0.3);
        box-shadow: 6px 6px 10px -5px #7b7b7b;
        padding-top: 12px;
        font-size: 21px;
        padding-right: 6px;
    }
    .right {
        right: 9px;
        border-radius: 50%;
        border: 1px solid rgba(123, 123, 123, 0.3);
        box-shadow: 6px 6px 10px -5px #7b7b7b;
        padding-top: 12px;
        font-size: 21px;
        padding-left: 6px;
    }
    .days-legend .day-legend {
        display: none!important;
    }
    .month {
        /*overflow: hidden;*/
        opacity: 0;
    }
    .month.new {
        -webkit-animation: fadeIn 1s ease-out;
        opacity: 1;
    }
    .month.in.next {
        animation: moveFromTopFadeMonth .4s ease-out;
        opacity: 1;
    }
    .month.out.next {
        animation: moveToTopFadeMonth .4s ease-in;
        opacity: 1;
    }
    .month.in.prev {
        animation: moveFromBottomFadeMonth .4s ease-out;
        opacity: 1;
    }
    .month.out.prev {
        animation: moveToBottomFadeMonth .4s ease-in;
        opacity: 1;
    }
    .week {
        background: #fff;
        text-align: center;
    }
    .day {
        display: inline-block;
        width: 110px;
        margin: 2px;
        text-align: center;
        vertical-align: top;
        cursor: pointer;
        color: #7b7b7b;
        background: #fff;
        padding: 5px 5px;
        position: relative;
        z-index: 100;
        border: 1px solid rgba(123, 123, 123, 0.3);
        border-radius: 3px;
    }
    .entry {
        position: relative;
        padding: 0 0 0 25px;
        font-size: 13px;
        display: inline-block;
        line-height: 30px;
        background: transparent;
    }
    .entry:after {
        position: absolute;
        content: '';
        height: 10px;
        width: 10px;
        top: 9px;
        left: 11px;
        border-radius: 50%;
    }
    .entry.red:after {
        background: rgba(229, 17, 47, 1);
    }
    .entry.blue:after {
        background: rgba(156, 202, 235, 1);
    }
    .entry.orange:after {
        background: rgba(247, 167, 0, 1);
    }
    .entry.green:after {
        background: rgba(153, 198, 109, 1);
    }
    .entry.yellow:after {
        background: rgba(249, 233, 0, 1);
    }
    /* Animations are cool!  */
    @keyframes moveFromTopFade {
        from {
            height: 0px;
            margin-top: 0px;
            transform: translateY(-100%);
        }
    }
    @keyframes moveToTopFade {
        to {
            height: 0px;
            transform: translateY(-100%);
        }
    }
    @keyframes moveToTopFadeMonth {
        to {
            opacity: 0;
            -moz-transform: translateY(-30%);
        }
    }
    @keyframes moveFromTopFadeMonth {
        from {
            opacity: 0;
            -moz-transform: translateY(30%);
        }
    }
    @keyframes moveToBottomFadeMonth {
        to {
            opacity: 0;
            -webkit-transform: translateY(30%);
        }
    }
    @keyframes moveFromBottomFadeMonth {
        from {
            opacity: 0;
            -webkit-transform: translateY(-30%);
        }
    }
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
    }
    @keyframes fadeOut {
        to {
            opacity: 0;
        }
    }
    @keyframes fadeOutShink {
        to {
            opacity: 0;
            padding: 0px;
            height: 0px;
        }
    }
}

@media(min-width:1201px) {
    *,
    *:before,
    *:after {
        box-sizing: border-box;
    }
    .calendar-container {
        overflow: hidden;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
        font-weight: 100;
        color: #7b7b7b;
        margin: 0;
        padding: 0;
        background: #fff;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
    }
    #calendar {
        transform: translate3d(0, 0, 0);
        width: 100%;
        margin: 0 auto;
        height: auto;
        overflow: hidden;
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
    }
    .header {
        padding: 40px 5px;
        width: 800px;
        background: #fff;
        text-align: center;
        position: relative;
        z-index: 100;
    }
    .header h1 {
        color: #e5112f;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
        margin: 0;
        padding: 0;
        line-height: 50px;
        font-weight: 100;
        letter-spacing: 1px;
    }
    .header-year {
        color: #7b7b7b;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
    }
    .left,
    .right {
        position: absolute;
        width: 50px;
        height: 50px;
        border-style: solid;
        top: 38%;
        margin-top: -7.5px;
        cursor: pointer;
    }
    .left {
        left: 250px;
        border-radius: 50%;
        border: 1px solid rgba(123, 123, 123, 0.3);
        box-shadow: 6px 6px 10px -5px #7b7b7b;
        padding-top: 12px;
        font-size: 21px;
        padding-right: 6px;
    }
    .right {
        right: 250px;
        border-radius: 50%;
        border: 1px solid rgba(123, 123, 123, 0.3);
        box-shadow: 6px 6px 10px -5px #7b7b7b;
        padding-top: 12px;
        font-size: 21px;
        padding-left: 6px;
    }
    .days-legend .day-legend {
        color: #e5112f;
        font-family: 'Baloo2Bold', Arial, Helvetica, sans-serif;
        font-size: 18px;
        line-height: 50px;
        letter-spacing: 1px;
        text-align: center;
    }
    .month {
        /*overflow: hidden;*/
        opacity: 0;
    }
    .month.new {
        -webkit-animation: fadeIn 1s ease-out;
        opacity: 1;
    }
    .month.in.next {
        animation: moveFromTopFadeMonth .4s ease-out;
        opacity: 1;
    }
    .month.out.next {
        animation: moveToTopFadeMonth .4s ease-in;
        opacity: 1;
    }
    .month.in.prev {
        animation: moveFromBottomFadeMonth .4s ease-out;
        opacity: 1;
    }
    .month.out.prev {
        animation: moveToBottomFadeMonth .4s ease-in;
        opacity: 1;
    }
    .week {
        background: #fff;
    }
    .day {
        display: inline-block;
        width: 110px;
        margin: 2px;
        text-align: center;
        vertical-align: top;
        cursor: pointer;
        color: #7b7b7b;
        background: #fff;
        padding: 5px 5px;
        position: relative;
        z-index: 100;
        border: 1px solid rgba(123, 123, 123, 0.3);
        border-radius: 3px;
    }
    .entry {
        position: relative;
        padding: 0 0 0 25px;
        font-size: 13px;
        display: inline-block;
        line-height: 30px;
        background: transparent;
    }
    .entry:after {
        position: absolute;
        content: '';
        height: 10px;
        width: 10px;
        top: 9px;
        left: 11px;
        border-radius: 50%;
    }
    .entry.red:after {
        background: rgba(229, 17, 47, 1);
    }
    .entry.blue:after {
        background: rgba(156, 202, 235, 1);
    }
    .entry.orange:after {
        background: rgba(247, 167, 0, 1);
    }
    .entry.green:after {
        background: rgba(153, 198, 109, 1);
    }
    .entry.yellow:after {
        background: rgba(249, 233, 0, 1);
    }
    /* Animations are cool!  */
    @keyframes moveFromTopFade {
        from {
            height: 0px;
            margin-top: 0px;
            transform: translateY(-100%);
        }
    }
    @keyframes moveToTopFade {
        to {
            height: 0px;
            transform: translateY(-100%);
        }
    }
    @keyframes moveToTopFadeMonth {
        to {
            opacity: 0;
            -moz-transform: translateY(-30%);
        }
    }
    @keyframes moveFromTopFadeMonth {
        from {
            opacity: 0;
            -moz-transform: translateY(30%);
        }
    }
    @keyframes moveToBottomFadeMonth {
        to {
            opacity: 0;
            -webkit-transform: translateY(30%);
        }
    }
    @keyframes moveFromBottomFadeMonth {
        from {
            opacity: 0;
            -webkit-transform: translateY(-30%);
        }
    }
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
    }
    @keyframes fadeOut {
        to {
            opacity: 0;
        }
    }
    @keyframes fadeOutShink {
        to {
            opacity: 0;
            padding: 0px;
            height: 0px;
        }
    }
}

#calendar .header {
    width: 100%;
}

#calendar .day {
    display: inline-block;
    /*width: 161px!important;*/
}

.calendar-day-card {
    border: 1px solid #ddd;
    padding: 5px;
    background-color: #ffffff;
    /*width: 161px;*/
    height: 180px;
    margin: 2px;
    display: inline-block;
}

.calendar-day-card:hover {
    border: 1px solid #e5112f;
    background-color: #f8ecec;
}

.calendar-day-card.other-month {
    background: #f1f1f1;
}

.calendar-day-card.has-events {
    border: 1px solid #e5112f;
}

.calendar-day-card.selected-day {
    border: 1px solid #e5112f;
    background-color: #f8ecec;
}

.calendar-day-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    border: none;
    padding: 2px 6px;
}

.calendar-day-card .card-header .day-number {
    font-size: 1rem;
    font-weight: bold;
    color: #cfcfcf;
}

.calendar-day-card .card-header .day-number.active {
    cursor: pointer;
    width: 90%;
    text-align: start;
}

.calendar-day-card.selected-day .card-header .day-number {
    color: #e5112f;
}

.calendar-day-card .card-header .arrow-buttons {
    display: none;
}

.calendar-day-card .card-header .arrow-buttons em {
    color: #e5112f;
    cursor: pointer;
    font-size: 1.3rem;
}

.calendar-day-card.has-events .arrow-buttons {
    display: flex;
    gap: 5px;
}

.calendar-day-card .card-header .arrow-buttons em.disabled {
    color: #f5a0ac;
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.calendar-day-card.has-three-events .card-header .arrow-buttons {
    display: none;
}

.calendar-day-card .card-header .arrow-buttons img:hover {
    transform: scale(1.1);
}

.calendar-day-card .event-list {
    height: 140px;
    overflow: hidden;
    cursor: pointer;
}

.calendar-day-card .event-list .event-card {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 0;
    border: 1px solid #eee;
    border-radius: 6px;
}

.calendar-day-card .event-list .event-card.lesson {
    border: 1px solid #5090c5;
}

.calendar-day-card .event-list .event-card.event {
    border: 1px solid #e5112f;
}

.calendar-day-card .event-list .event-card:last-child {
    margin-bottom: 0;
}

.calendar-day-card .event-list .event-card .event-image {
    width: 40px;
    height: 40px;
    margin-right: 5px;
    -o-object-fit: cover;
       object-fit: cover;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.calendar-day-card .event-list .event-card .event-details {
    font-size: 0.85rem;
}

.calendar-day-card .event-list .event-card .event-details .title {
    font-weight: bold;
    color: #333;
    text-transform: capitalize;
}

.calendar-day-card .event-card.lesson .event-details .title {
    color: #6199c9;
}

.calendar-day-card .event-card.event .event-details .title {
    color: #e5112f;
}

.calendar-day-card .event-list .event-card .event-details .subtitle {
    font-size: 0.75rem;
    color: #666;
    line-height: 18px;
}

#calendar .legend-wrapper {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    max-width: 100%;
    margin-top: 10px;
}

#calendar .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#calendar .legend-item:last-child {
    margin-bottom: 0;
}

#calendar .legend-marker {
    width: 80px;
    height: 20px;
    margin-right: 10px;
    border-radius: 4px;
    background: white;
}

#calendar .legend-marker.lesson {
    border: 2px solid #5090c5;
}

#calendar .legend-marker.event {
    border: 2px solid #e5112f;
}

#calendar .legend-label {
    font-weight: bold;
    margin-right: 10px;
}

#calendar .legend-description {
    font-size: 0.85rem;
    color: #555;
}

#calendar .calendar-day-card .event-list {
    height: 140px;
    overflow: hidden;
    position: relative;
}

#calendar .calendar-day-card .event-list.has-more-event {
    overflow-y: hidden;
}

#calendar .calendar-day-card .event-list {
    scrollbar-color: #e5112f #f5a0ac;
    scrollbar-width: thin;
}

#calendar .calendar-day-card .event-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#calendar .calendar-day-card .event-list::-webkit-scrollbar-thumb {
    background-color: #e5112f;
    border-radius: 4px;
    border: 2px solid #f5a0ac;
}

#calendar .calendar-day-card .event-list::-webkit-scrollbar-track {
    background-color: #f5a0ac;
    border-radius: 4px;
}

.event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #686868;
}

.close-modal {
    cursor: pointer;
    font-size: 20px;
    color: #686868;
}

.modal-body {
    margin-top: 20px;
    max-height: 500px;
    overflow: auto;
}

#calendar .calendar-day-card .event-list,
.event-modal .modal-body {
    scrollbar-color: #e5112f #f5a0ac;
    scrollbar-width: thin;
}

.event-modal .modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.event-modal .modal-body::-webkit-scrollbar-thumb {
    background-color: #e5112f;
    border-radius: 4px;
    border: 2px solid #f5a0ac;
}

.event-modal .modal-body::-webkit-scrollbar-track {
    background-color: #f5a0ac;
    border-radius: 4px;
}

.modal-body .event-card {
    display: flex;
    align-items: start;
    margin-bottom: 5px;
    padding: 0;
    border-radius: 6px;
    padding-right: 5px;
    cursor: pointer;
}

.modal-body .event-card.lesson {
    border: 1px solid #5090c5;
}

.modal-body .event-card.event {
    border: 1px solid #e5112f;
}

.modal-body .event-card:last-child {
    margin-bottom: 0;
}

.modal-body .event-card .event-image {
    width: 100px;
    height: auto;
    margin-right: 5px;
    -o-object-fit: cover;
       object-fit: cover;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.modal-body .event-card.lesson .event-image-container {
    width: 100px;
    height: 100px;
    margin-right: 5px;
    -o-object-fit: cover;
       object-fit: cover;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-body .event-card.lesson .event-image {
    border-bottom-left-radius: 0;
}

.modal-body .event-details {
    flex-grow: 1;
    padding: 2px 5px;
}

.modal-body .event-card .event-details .title {
    font-weight: bold;
    text-transform: capitalize;
}

.modal-body .event-card .event-details .subtitle {
    font-size: 0.75rem;
    line-height: 18px;
}

.modal-body .event-card.lesson .event-details .title {
    color: #6199c9;
}

.modal-body .event-card.event .event-details .title {
    color: #e5112f;
}

.modal-body .status {
    font-weight: bold;
    font-size: 1rem;
    margin-top: 5px;
    padding: 5px 10px;
    width: 90px;
    text-align: center;
}

.modal-body .status.passed {
    color: #aaaaaa;
    border: 1px solid #aaaaaa;
    border-radius: 6px;
}

.modal-body .status.upcoming {
    color: #5e7a3a;
    border: 1px solid #5e7a3a;
    border-radius: 6px;
}

.hidden {
    display: none;
}

.week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 0 5px;
    box-sizing: border-box;
}

.days-legend {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 0 5px;
    box-sizing: border-box;
}

.day.day-legend {
    width: auto;
}

.calendar-size {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 5px;
    box-sizing: border-box;
}

.calendar-size .day-card {
    background-color: #f3f4f6;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: start;
    justify-content: start;
}

.calendar-size {
    width: 100%;
}

@media (max-width: 768px) {
    .calendar-size .day-card {
        font-size: 14px;
        padding: 15px;
    }
    .week {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 1px;
        padding: 5px;
        box-sizing: border-box;
    }
    .calendar-day-card {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-size .day-card {
        font-size: 12px;
        padding: 10px;
    }
}

.custom-tooltip {
    position: absolute;
    background-color: #e5112f;
    color: white;
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    transform: translateY(-150%);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.custom-tooltip.visible {
    opacity: 1;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 10px;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--tooltip-arrow-color, #e5112f) transparent transparent transparent;
}

.lesson:hover~.custom-tooltip {
    background-color: #5090c5;
    color: white;
}

.lesson:hover~.custom-tooltip::after {
    border-color: #5090c5 transparent transparent transparent;
}

.lesson.event:hover~.custom-tooltip {
    background-color: white;
    color: #e5112f;
    border: 1px solid #e5112f;
}

.lesson.event:hover~.custom-tooltip::after {
    border-color: white transparent transparent transparent;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 6px solid #ccc;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.event-card.card-booked {
    border-left-color: #10b981;
    background-color: #f0fdf4;
}

.event-card.card-available {
    border-left-color: #3b82f6;
    background-color: #eff6ff;
}

.event-card.card-event {
    border-left-color: #ef4444;
    background-color: #fef2f2;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-booked {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-available {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-event {
    background-color: #fee2e2;
    color: #991b1b;
}

.event-details {
    flex-grow: 1;
}

.event-details .title {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
}

.event-details .lesson-name {
    font-weight: 600;
    color: #4b5563;
}

.event-details .subtitle {
    font-size: 12px;
    color: #6b7280;
}

.event-details .time-slot {
    font-weight: 500;
    color: #374151;
    margin-top: 2px;
}

.status {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
}

.status.upcoming {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status.passed {
    background-color: #f3f4f6;
    color: #9ca3af;
}
