/* MultiUserCalendar コンポーネント - モバイル最適化された横スクロール複数ユーザースケジュール */

.multi-user-calendar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f5f5f5;
}

.multi-user-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.date-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
}

.date-label__day {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.date-label__full {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.nav-button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-button:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.nav-button:active {
    background-color: #e0e0e0;
}

.multi-user-calendar__secondary-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.secondary-button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-button:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.secondary-button:active {
    background-color: #e0e0e0;
}

.multi-user-calendar__state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    color: #666;
    font-size: 14px;
}

.multi-user-calendar__state--error {
    color: #d32f2f;
}

.multi-user-calendar__scroll-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 0;
    background-color: #f5f5f5;
    /* スムーススクロールを有効化 */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

/* ユーザー列 */
.user-calendar-column {
    flex: 0 0 280px; /* 固定幅 */
    min-width: 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
}

.user-calendar-column:last-child {
    border-right: none;
}

.user-calendar-column__header {
    padding: 12px;
    background-color: #fafafa;
    border-bottom: 2px solid #e0e0e0;
    text-align: center;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* 終日予定セクション */
.all-day-section {
    padding: 8px 12px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    max-height: 150px;
    overflow-y: auto;
}

.all-day-section__title {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 500;
}

/* タイムライン */
.user-calendar-timeline {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 50px 1fr;
    column-gap: 0;
    height: 100%;
}

.timeline-labels {
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
    border-right: 1px solid #e0e0e0;
}

.timeline-label {
    height: var(--hour-height);
    padding: 4px 8px;
    font-size: 11px;
    color: #999;
    text-align: right;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.timeline-slots {
    position: relative;
}

.timeline-slot {
    height: var(--hour-height);
    border-bottom: 1px solid #e8e8e8;
    background-color: #fff;
}

/* イベントレイヤー */
.event-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.event-card {
    position: absolute;
    left: 0;
    right: 0;
    padding: 8px 12px;
    border-left: 3px solid #1890ff;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s;
}

.event-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.event-card--allday {
    position: relative;
    margin-bottom: 4px;
    left: 0;
    right: 0;
}

.event-card__title,
.event-card__time,
.event-card__meta {
    line-height: inherit;
    margin-block: 2px;
}

.event-card__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

.event-card__time {
    font-size: 11px;
    margin-top: 2px;
    opacity: 0.8;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

.event-card__meta {
    font-size: 11px;
    margin-top: 2px;
    opacity: 0.7;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

/* 現在時刻インジケーター */
.current-time {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ff4444;
    z-index: 10;
    pointer-events: none;
}

.current-time__dot {
    position: absolute;
    left: 42px;
    top: -4px;
    width: 8px;
    height: 8px;
    background-color: #ff4444;
    border-radius: 50%;
}

/* モバイル最適化 */
@media (max-width: 768px) {
    .user-calendar-column {
        flex: 0 0 240px;
        min-width: 240px;
        max-width: 240px;
    }

    .timeline-label {
        width: 45px;
        font-size: 10px;
    }

    .event-layer {
        left: 45px;
    }

    .event-card__title {
        font-size: 12px;
    }

    .event-card__time,
    .event-card__meta {
        font-size: 10px;
    }
}

/* タブレット表示 */
@media (min-width: 769px) and (max-width: 1024px) {
    .user-calendar-column {
        flex: 0 0 260px;
        min-width: 260px;
        max-width: 260px;
    }
}

/* デスクトップ表示 - より多くの列を表示 */
@media (min-width: 1025px) {
    .user-calendar-column {
        flex: 0 0 320px;
        min-width: 320px;
        max-width: 320px;
    }
}
