/* Основное */
.widget:has(.events-calendar) {
    padding: 0;
    max-width: 350px;
}

.full-calendar-content-sidebar {
    padding: 0;
    max-width: 350px;
    width: 100%;
    height: max-content;
}

.events-calendar {
    background-color: #F7F8FA;
    border-radius: 10px;
    box-shadow: 0 0 2px rgba(209, 209, 209, 0.18);
    /*padding: 12px 40px 12px 40px;*/
}

.events-calendar__top_header {
    background-color: transparent;
    border-radius: 10px;
    padding: 12px 40px 0 40px;
}

.events-calendar__top_header .events-calendar__top_header_title {
    text-align: center;
    font-size: 24px;
    line-height: 60px;
}

.calendar__content {
    width: 100%;
    padding: 0 40px 40px;
    min-height: 384px;
}

.calendar__content.overflow {
    overflow-y: auto;
    max-height: 340px;
    scrollbar-width: thin;
    scrollbar-color: #373A4C #F7F8FA;
}

.calendar__content .events-calendar__page-main {
    width: 100%;
}

/* Слайдер выбора недель */
.calendar-week-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    user-select: none;
}

#EventCalendar_WeekPicker_Wrapper {
    overflow: hidden;
    position: relative;
    flex-grow: 1;
}

.calendar-week-slider {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.week-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
}

/* Скелетоны (Заглушки) */
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.5) 20%,
            rgba(255, 255, 255, 0.8) 60%,
            rgba(255, 255, 255, 0));
    animation: skeleton-shimmer 2s infinite;
}

.skeleton-item {
    background: #f0f2f5;
    border-radius: 4px;
}

.skeleton-tag {
    width: 60px;
    height: 16px;
}

.skeleton-title {
    width: 80%;
    height: 24px;
}

.skeleton-text {
    width: 100%;
    height: 60px;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}


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

.calendar-page-month {
    display: flex;
    justify-content: center;
    flex-grow: 1;
}

.calendar-page-month-help {
    margin-left: auto;
    width: 16px;
    height: 16px;
    background-color: #FFCA10;
    font-size: 12px;
    line-height: 15px;
    text-align: center;
    border-radius: 8px;
    user-select: none;
    cursor: pointer;
    position: relative;
    top: 2px;
}

.calendar-slide-btn {
    cursor: pointer;
}

.calendar-page-month .calendar-slide-btn {
    border-radius: 20px;
    width: 21px;
    height: 21px;
}

.calendar-page-month .calendar-current-date {
    margin-left: 20px;
    margin-right: 20px;
    position: relative;
    top: 1px;
}


.calendar__grid {
    user-select: none;
}

.calendar__grid .calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    aspect-ratio: 1 / 1;
    transition: 0.3s;
    cursor: pointer;
    width: 30px;
    height: 30px;
    padding: 4px;
}

.calendar__grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    justify-items: center;
    align-items: center;
    gap: 10px 10px;
    margin-bottom: 10px;
}

.calendar__grid-header .calendar-day {
    color: #373A4C;
}


.calendar__grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    justify-items: center;
    align-items: center;
    gap: 17px 10px;
}

.calendar__grid-body .calendar-day {
    background-color: #fff;
}

.calendar__grid-body .calendar-day:hover {
    background-color: #D8DAE7;
}

.calendar__grid-body .calendar-day.day-not-current-month {
    background-color: #f3f3f3;
    color: #a6a6a6;
    visibility: hidden;
}

.calendar__grid-body .calendar-day.day-current {
    border: 1px solid #E04265;
}

.calendar-day .calendar-day-number {
    line-height: 20px;
}

.calendar-day .calendar-day-tags {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 65%;
}

.calendar-day .calendar-day-tags .calendar-day-tag {
    width: 4px;
    height: 4px;
    background-color: #0a9822;
    border-radius: 5px;
}

.hidden {
    display: none;
}

/** Страница дня */

.calendar_day_events {
    margin-top: 10px;
}

.calendar_day_event {
    width: 100%;
    margin-bottom: 12px;
}

.full-calendar-near-events-wrapper .calendar_day_event {
    margin-bottom: 20px;
}

.calendar_day_event hr {
    width: 100%;
    border-top: 1px solid #D8DAE7;
    margin: 0;
}

.calendar_day_event:last-child hr {
    display: none;
}

.calendar_day_event .day_event-image {
    margin-bottom: 10px;
}

.calendar_day_event .day_event-image img {
    width: 100%;
    border-radius: 10px;
}

.calendar_day_event .day_event-data {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    font-size: 12px;
}

.day_event-data .day_event-tag {
    width: 7px;
    height: 7px;
    border-radius: 10px;
    background-color: #de4164;
    margin-right: 10px;
    min-width: 7px;
    min-height: 7px;
}

.day_event-data .day_event-text {
    line-height: 22px;
}

.day_event-text .day_event-text-title {
    font-weight: bold;
}

.day_event-text .day_event-text-field p,
.day_event-text .day_event-text-field div,
.day_event-text .day_event-text-field span {
    margin: 0;
    padding: 0;
}


.calendar-legend-wrapper {
    position: absolute;
    /* Позиционирование относительно родителя */
    z-index: 1;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    left: -180px;
    width: 234px;
    border-radius: 10px;
    color: #000;
}

.calendar-legend-wrapper .legend-header {
    text-align: left;
    margin-bottom: 10px;
    font-size: 14px;
}

.calendar-legend-wrapper .legend-tag-wrapper {
    display: flex;
    align-items: center;
}

.legend-tag-wrapper .legend-tag {
    width: 7px;
    height: 7px;
    border-radius: 15px;
    background-color: #de4164;
    margin-right: 10px;
}

.legend-tag-wrapper .legend-desc {
    text-align: left;
}

.legend-tag-wrapper .legend-tag-dash {
    margin-right: 5px;
}




.event-calendar-full-page {
    width: 100%;
}

.full-calendar-near-events-wrapper {
    flex-grow: 1;
    background-color: #F7F8FA;
    margin-right: 45px !important;
    border-radius: 10px;
    padding: 40px 30px 30px 30px;
}

.full-calendar-content-sidebar {
    background-color: #F7F8FA;
    max-width: 350px;
    border-radius: 10px;
    height: max-content;
}

.calendar-near-events-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.calendar-near-events-header .calendar-slide-btn {
    margin-right: 10px;
}

.calendar-near-events-header h3 {
    text-align: center;
    margin: 0;
}

.training-container .widget:has(.events-calendar),
.inner-training-page .widget:has(.events-calendar) {
    max-width: none;
    width: 100%;
}

@media (max-width: 920px) {
    .full-calendar-near-events-wrapper {
        flex-direction: column;
        width: 100%;
    }
}

@media screen and (max-width: 920px),
only screen and (max-device-width: 920px) {
    .event-calendar-full-page {
        display: flex !important;
        flex-direction: column;
        align-items: center;
    }

    .full-calendar-near-events-wrapper {
        margin-right: 0 !important;
        margin-bottom: 45px;
    }
}

@media screen and (max-width: 400px),
only screen and (max-device-width: 400px) {
    .events-calendar__top_header {
        padding: 12px 12px !important;
    }

}

@media screen and (max-width: 350px),
only screen and (max-device-width: 350px) {
    .events-calendar__top_header_title {
        font-size: 16px !important;
    }

    .calendar__content {
        padding: 0 5px 15px !important;
        min-height: auto;
    }

    .calendar__grid-header {
        gap: 10px 3px !important;
    }

    .calendar__grid-body {
        gap: 10px 5px !important;
    }


}

/** НОВЫЙ ДИЗАЙН ПОЛНОЙ СТРАНИЦЫ (/event-calendar) **/

.event-calendar-full-page {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 0;
    font-family: inherit;
    /* Системные шрифты */
    display: flex;
    justify-content: center;
}

.event-calendar-full-page .full-calendar-near-events-wrapper {
    max-width: 800px;
    width: 100%;
    margin-right: 0 !important;
    padding: 0;
    background-color: #ffffff;
}

/* Карточка события */
.day_event-card {
    background: #FFFFFF;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    overflow: hidden;
    box-shadow: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    border: 1px solid #eee;
    text-align: left;
}

.day_event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0;
}

.day_event-tag-marker {
    width: 6px;
    flex-shrink: 0;
}

.day_event-content {
    padding: 16px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.day_event-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.day_event-tag-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.day_event-time {
    font-size: 12px;
    color: #242424;
    font-weight: 400;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.day_event-time::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.day_event-body {
    display: flex;
    gap: 20px;
}

.day_event-info {
    flex-grow: 1;
}

.day_event-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #000;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
}

.day_event-description {
    margin: 0;
    font-size: 16px;
    color: #444;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-events-text {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    font-style: italic;
    padding: 20px 0;
}

.day_event-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.day_event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Навигация (Week Picker) */
.calendar-week-nav-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    padding: 0 0 20px;
}

.calendar-header-with-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-week-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: transparent;
    padding: 10px 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.nav-week-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    background: transparent;
    border: none;
    padding: 0 20px;
    /* Умеренный воздух для десктопа */
    color: #bbb;
    /* Чуть темнее, чтобы не терялись */
}

.nav-week-btn:hover {
    color: #000;
}

.nav-week-btn svg {
    display: block;
    width: 15px;
    height: 48px;
    /* Высокие стрелки */
}

@media (max-width: 500px) {
    .nav-week-btn {
        display: none !important;
    }

    .calendar-week-picker-wrapper {
        gap: 0;
    }

    .calendar-header-with-nav {
        margin-bottom: 0;
    }
}

.week-day-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    transition: background 0.2s;
    min-width: 45px;
}

.week-day-item:hover {
    background: #f0f4f8;
}

.nav-today-btn {
    padding: 8px 16px;
    background: #f0f4f8;
    color: #0772A0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-today-btn:hover {
    background: #0772A0;
    color: #fff;
}

.nav-today-btn.hidden {
    display: none;
}

/* Заголовок страницы */
#EventCalendar_NearPageEvents_SelectedDate {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 15px !important;
    margin: 0 !important;
    border: none !important;
}

#EventCalendar_NearPageEvents_SelectedDate .current-month {
    font-size: 38px !important;
    font-weight: 500 !important;
    color: #000 !important;
    line-height: 1 !important;
    text-transform: capitalize !important;
}

#EventCalendar_NearPageEvents_SelectedDate .current-year {
    font-size: 20px !important;
    font-weight: 400 !important;
    color: #888 !important;
    margin-top: 0 !important;
}

/* Фиксация контента при скролле */
.calendar-day-block {
    scroll-margin-top: 200px;
    margin-bottom: 40px;
}

.calendar-day-block-title {
    font-size: 20px !important;
    font-weight: 500;
    margin: 0 0 15px 6px;
    color: #333;
    padding-bottom: 0px;
    /* border-bottom: 1px solid #eee; */
}

/* Активный день в навигации */
.week-day-item.today {
    box-shadow: inset 0 0 0 1px #0772A0;
}

.week-day-item.active {
    background: #0772A0;
    color: #fff;
}

.week-day-name {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 4px;
}

.week-day-date {
    font-size: 28px;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 600px) {
    .day_event-body {
        flex-direction: column-reverse;
    }

    .day_event-image {
        width: 100%;
        height: 150px;
    }

    #events_calendar .ec-content-wrap {
        padding: 0px 0 20px !important;
    }

    .week-day-item {
        padding: 10px;
    }

    .calendar-header-with-nav {
        margin-bottom: 0;
    }

    .week-day-name {
        font-size: 12px;
    }

    .week-day-date {
        font-size: 18px;
    }
}

#events_calendar .ec-content-wrap {
    padding: 0px 0 40px !important;
}