/* =============================================
   CALENDAR PANEL — панель календаря интервью
   ============================================= */

.calendar-panel {
    position: fixed;
    top: 0;
    left: 300px;
    right: 60px; /* Оставляем место для правой панели кнопок */
    height: 100vh;
    background: #FAFAFA;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
}

.calendar-panel.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

aside#sidebar.collapsed ~ .chat-wrapper .calendar-panel,
.calendar-panel.sidebar-collapsed {
    left: 60px;
}

/* =============================================
   HEADER
   ============================================= */

.calendar-panel-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 40px;
    flex-shrink: 0;
    background: #FAFAFA;
}

.calendar-panel-back {
    width: 40px;
    height: 40px;
    border: 1.5px solid #E0E0E0;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    color: #333;
}

.calendar-panel-back:hover {
    background: #F0F0F0;
}

.calendar-panel-title {
    font-size: 1.6em;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

/* =============================================
   BODY — два столбца: (календарь + экспорт) | события
   ============================================= */

.calendar-panel-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0 40px 32px;
    gap: 32px;
    align-items: flex-start;
}

/* Левая часть — календарь + кнопки экспорта */
.calendar-panel-left {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Правая часть — список событий */
.calendar-panel-right {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
}

/* =============================================
   МИНИ-КАЛЕНДАРЬ
   ============================================= */

.cp-cal {
    background: #fff;
    border-radius: 20px;
    padding: 28px 28px 24px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.cp-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cp-cal-month {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a2e;
}

.cp-cal-nav {
    display: flex;
    gap: 4px;
}

.cp-cal-nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.4em;
    color: #5B5FED;
    padding: 2px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s;
}

.cp-cal-nav-btn:hover {
    background: #F2F4FF;
}

.cp-cal-nav-btn:disabled {
    color: #ccc;
    cursor: default;
}

.cp-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 42px);
    text-align: center;
    font-size: 0.78em;
    color: #bbb;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cp-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 42px);
    row-gap: 2px;
}

.cp-cal-day {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #222;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.cp-cal-day:hover:not(.cp-cal-day--overflow):not(.cp-cal-day--disabled) {
    background: #F2F4FF;
}

.cp-cal-day--overflow {
    color: #ccc;
    cursor: default;
}

.cp-cal-day--past:not(.cp-cal-day--today) {
    color: #ccc;
    cursor: default;
}

.cp-cal-day--past.cp-cal-day--has-event:not(.cp-cal-day--today) {
    border-color: #ddd;
    font-weight: 400;
}

.cp-cal-day--today {
    background: #5B5FED;
    color: #fff;
    font-weight: 700;
}

.cp-cal-day--has-event:not(.cp-cal-day--today):not(.cp-cal-day--selected) {
    border: 2px solid #5B5FED;
    font-weight: 600;
}

.cp-cal-day--selected:not(.cp-cal-day--today) {
    background: #5B5FED;
    color: #fff;
    font-weight: 700;
}

.cp-cal-day--disabled {
    color: #ddd;
    cursor: default;
}

/* =============================================
   СПИСОК СОБЫТИЙ
   ============================================= */

.cp-event-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.cp-event-date {
    flex: 0 0 64px;
    text-align: left;
}

.cp-event-date-day {
    font-size: 1em;
    font-weight: 600;
    color: #222;
    line-height: 1.2;
}

.cp-event-date-time {
    font-size: 0.82em;
    color: #aaa;
    margin-top: 3px;
}

.cp-event-divider {
    width: 1.5px;
    align-self: stretch;
    background: #E8E8F0;
    border-radius: 2px;
    flex-shrink: 0;
}

.cp-event-info {
    flex: 1;
    min-width: 0;
    padding-left: 4px;
}

.cp-event-title {
    font-size: 0.97em;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-event-subtitle {
    font-size: 0.82em;
    color: #aaa;
    margin-top: 3px;
}

.cp-event-bell {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: default;
    background: #EEEEFF;
}

.cp-event-bell--active {
    background: #5B5FED;
}

.cp-event-bell svg {
    width: 18px;
    height: 18px;
    stroke: #bbb;
}

.cp-event-bell--active svg {
    stroke: #fff;
}

.cp-event-bell[style*="cursor: pointer"]:hover {
    opacity: 0.8;
    transition: opacity 0.15s;
}

/* =============================================
   АНИМАЦИЯ СМЕНЫ ВИДА
   ============================================= */

.calendar-panel-right {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.calendar-panel-right.cp-pane--exit {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

/* =============================================
   ЗАГОЛОВОК ПАНЕЛИ СОБЫТИЙ
   ============================================= */

.cp-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.cp-pane-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a1a2e;
}

/* Кнопка закрытия day-view */
.cp-day-close {
    width: 30px;
    height: 30px;
    border: none;
    background: #EEEEFF;
    border-radius: 50%;
    font-size: 1.2em;
    color: #5B5FED;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    font-family: inherit;
    flex-shrink: 0;
}

.cp-day-close:hover {
    background: #D8DAFF;
}

/* =============================================
   СПИСОК КАРТОЧЕК
   ============================================= */

.cp-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ─── Day-view карточка: акцентное время слева ─── */

.cp-event-card--day .cp-event-time-accent {
    flex: 0 0 56px;
    font-size: 1.1em;
    font-weight: 700;
    color: #5B5FED;
    letter-spacing: 0.01em;
}

/* Пустое состояние */
.cp-events-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
    color: #bbb;
    font-size: 0.95em;
    text-align: center;
}

/* =============================================
   EXPORT BUTTONS — под календарём в левой колонке
   ============================================= */

#calendar-panel-export {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp-export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 20px;
    border: 1.5px solid #D0D4E8;
    border-radius: 24px;
    background: #fff;
    font-size: 0.92em;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    font-family: inherit;
}

.cp-export-btn:hover {
    border-color: #5B5FED;
    box-shadow: 0 2px 8px rgba(91,95,237,0.12);
}

.cp-export-btn img {
    height: 20px;
    width: auto;
}

/* Mobile */
@media (max-width: 768px) {
    .calendar-panel,
    .calendar-panel.sidebar-collapsed {
        left: 0 !important;
        right: 0 !important;
        overflow-y: auto;
    }

    .calendar-panel-body {
        flex-direction: column;
        padding: 0 16px 24px;
        gap: 16px;
    }

    .calendar-panel-left {
        width: 100%;
    }

    .calendar-panel-right {
        width: 100%;
    }

    .cp-cal {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .cp-cal-weekdays,
    .cp-cal-days {
        grid-template-columns: repeat(7, 1fr);
    }

    .cp-cal-day {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        min-width: 0;
        font-size: 0.85em;
    }

    .cp-cal-header {
        padding: 0 0 12px;
    }

    /* Кнопки экспорта — полная ширина */
    .cp-export-btn {
        width: 100%;
        box-sizing: border-box;
    }

    /* Временные слоты — 3 колонки */
    .cal-time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Header панели */
    .calendar-panel-header {
        padding: 16px;
    }
}

@media (max-width: 380px) {
    .cp-cal {
        padding: 12px 8px;
    }

    .cp-cal-day {
        font-size: 0.8em;
    }
}
