/* ===========================
   カレンダー連携機能CSS
   =========================== */

/* カレンダーコンテナ */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* カレンダーヘッダー */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.calendar-actions {
    display: flex;
    gap: 12px;
}

/* カレンダー本体 */
#calendar {
    min-height: 600px;
}

/* FullCalendarカスタマイズ */
.fc {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

.fc-toolbar {
    margin-bottom: 20px;
}

.fc-toolbar-title {
    font-size: 20px;
    font-weight: 600;
}

.fc-button {
    background: #4a90e2;
    border: none;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.fc-button:hover {
    background: #357abd;
}

.fc-button-active {
    background: #2968a3;
}

.fc-button:disabled {
    background: #e0e0e0;
    color: #999;
}

.fc-button-group .fc-button {
    border-radius: 0;
}

.fc-button-group .fc-button:first-child {
    border-radius: 6px 0 0 6px;
}

.fc-button-group .fc-button:last-child {
    border-radius: 0 6px 6px 0;
}

/* カレンダーテーブル */
.fc-scrollgrid {
    border: 1px solid #e0e0e0;
}

.fc-col-header-cell {
    background: #f8f9fa;
    padding: 12px 8px;
}

.fc-daygrid-day {
    border: 1px solid #e0e0e0;
}

.fc-daygrid-day:hover {
    background: #f8f9fa;
    cursor: pointer;
}

.fc-day-today {
    background: #e8f0fe !important;
}

.fc-daygrid-day-number {
    padding: 8px;
    font-weight: 500;
}

/* イベント表示 */
.fc-event {
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.fc-event:hover {
    opacity: 0.8;
}

.fc-event-time {
    font-weight: 600;
    margin-right: 4px;
}

.fc-event-title {
    font-weight: 500;
}

/* もっと見るリンク */
.fc-more-link {
    color: #4a90e2;
    font-weight: 500;
}

/* イベントモーダル */
.calendar-event-modal .modal-content {
    max-width: 500px;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.info-item i {
    width: 20px;
    color: #6c757d;
}

.info-item a {
    color: #4a90e2;
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

.event-description {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.event-description h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.event-description p {
    color: #495057;
    line-height: 1.6;
}

/* カレンダービュー切り替え */
.view-switcher {
    display: flex;
    gap: 8px;
}

.view-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: #f8f9fa;
    border-color: #4a90e2;
}

.view-btn.active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
}

/* エクスポートオプション */
.export-options {
    position: relative;
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
}

.export-dropdown.active {
    display: block;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.export-option:hover {
    background: #f8f9fa;
}

.export-option:first-child {
    border-radius: 8px 8px 0 0;
}

.export-option:last-child {
    border-radius: 0 0 8px 8px;
}

.export-option i {
    width: 20px;
    color: #6c757d;
}

/* リスト表示 */
.fc-list {
    border: none;
}

.fc-list-event {
    cursor: pointer;
}

.fc-list-event:hover td {
    background: #f8f9fa;
}

.fc-list-day th {
    background: #e8f0fe;
    padding: 12px 16px;
    font-weight: 600;
}

.fc-list-event-time {
    color: #6c757d;
}

.fc-list-event-title {
    color: #212529;
}

/* ローディング */
.calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #6c757d;
}

.calendar-loading i {
    font-size: 32px;
    margin-right: 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .calendar-container {
        padding: 16px;
    }

    .calendar-header {
        flex-direction: column;
        gap: 16px;
    }

    .calendar-actions {
        width: 100%;
        justify-content: center;
    }

    #calendar {
        min-height: 400px;
    }

    .fc-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    .fc-toolbar-title {
        font-size: 18px;
    }

    .fc-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .fc-daygrid-event {
        font-size: 11px;
    }

    .calendar-event-modal .modal-content {
        max-width: 90%;
    }
}