/* 患者向けスケジュール表示用CSS */

.patient-schedule-container {
    margin: 20px 0;
}

/* PC版：科ボタンを上部に配置 */
@media (min-width: 768px) {
    .patient-schedule-layout {
        display: block;
    }
    
    .department-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 20px;
        justify-content: center;
    }
    
    .schedule-calendar {
        width: 100%;
        margin-bottom: 0;
    }
}

/* モバイル版：縦並び */
@media (max-width: 767px) {
    .patient-schedule-layout {
        display: block;
    }
    
    .department-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        margin-bottom: 20px;
    }
}

.department-tab {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.department-tab:hover {
    background: #e9ecef;
    text-decoration: none;
    color: #333;
}

.department-tab.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.schedule-calendar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    padding: 6px 15px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.calendar-nav button:hover {
    background: #005a87;
}

.calendar-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    background: #ddd;
    border: 2px solid #ddd;
}

.calendar-day-header {
    background: #f5f5f5;
    padding: 8px;
    text-align: center;
    font-weight: bold;
    color: #333;
    font-size: 12px;
    border-right: 1px solid #ddd;
}

.calendar-day-header:nth-child(6n) {
    border-right: none;
}

.calendar-day {
    background: #fff;
    min-height: 80px;
    padding: 5px;
    border-right: 2px solid #eee;
    border-bottom: 2px solid #eee;
    position: relative;
    word-break: break-all;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* テーブルセル内の改行設定 */
.table td {
    word-break: break-all;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}



/* 月曜日、水曜日、金曜日の背景色（薄いグレー） */
.calendar-day:nth-child(6n+1),
.calendar-day:nth-child(6n+3),
.calendar-day:nth-child(6n+5) {
    background: #f8f9fa;
}

/* 火曜日、木曜日、土曜日の背景色（白） */
.calendar-day:nth-child(6n+2),
.calendar-day:nth-child(6n+4),
.calendar-day:nth-child(6n+6) {
    background: #fff;
}

/* 重なり合う部分の調整：右端の枠線を削除 */
.calendar-day:nth-child(6n) {
    border-right: none;
}

/* 重なり合う部分の調整：下端の枠線を削除 */
.calendar-day:nth-last-child(-n+6) {
    border-bottom: none;
}

.calendar-day.other-month {
    background: #f9f9f9;
    color: #999;
}

.calendar-day.today {
    background: #e7f3ff;
    border-color: #0073aa;
}

.calendar-day-number {
    font-weight: normal;
    margin-bottom: 5px;
    font-size: 14px;
}

/* スケジュールコンテナ */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 1px;
    height: 100%;
}

/* スケジュール期間エリア */
.schedule-period {
    flex: 1;
    border-radius: 2px;
    padding: 2px;
    min-height: 20px;
    margin-bottom: 2px;
}

.period-label {
    font-size: 10px;
    font-weight: normal;
    color: #333;
    text-align: center;
    margin-bottom: 1px;
    padding: 2px 4px;
    border-radius: 2px;
    display: block;
    background: #ffffff;
    border: 1px solid #ddd;
}

.period-label.am {
    background: #C1CFDB;
    color: #333;
}

.period-label.pm {
    background: #DBCDC1;
    color: #333;
}

/* 内視鏡検査用のラベル背景色 */
.period-label.upper-am {
    background: #ffffff;
    color: #333;
}

.period-label.upper-pm {
    background: #ffffff;
    color: #333;
}

.period-label.lower-pm {
    background: #ffffff;
    color: #333;
}
/*
.doctor-area.am {
}

.doctor-area.pm {
}
*/
/* 内視鏡検査用の背景色 */
.schedule-period.endoscope-upper-am {
}

.schedule-period.endoscope-upper-pm {
}

.schedule-period.endoscope-lower-pm {
}

/* 医師名表示エリアの背景を透明に */
.doctors-list {
    background: transparent;
}

.doctors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    align-items: flex-start;
}

.doctor-item {
    font-size: 1rem;
    padding: 0 1px;
    border-radius: 1px;
    background: transparent;
    color: #333;
    display: inline-block;
    margin: 1px;
}

.doctor-name {
    font-weight: normal;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

.doctor-name:hover {
    text-decoration: none;
}

.doctor-name:hover {
    color: #333;
    text-decoration: none;
}

/* 女性医師の名前を赤色で表示 */
.doctor-name.female {
    color: #dc3545;
}

.doctor-name.female:hover {
    color: #dc3545;
    text-decoration: none;
}

/* 通常科目の期間エリア */
.am-period {
}

.pm-period {
}

/* 内視鏡検査の期間エリア */
.endoscope-upper-am {
}

.endoscope-upper-pm {
}

.endoscope-lower-pm {
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
    .calendar-grid {
        grid-template-columns: repeat(6, 1fr);
        font-size: 11px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 2px;
    }
    
    .calendar-day-number {
        font-size: 13px;
    }
    
    .schedule-info {
        font-size: 8px;
    }
    
    .department-tab {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* 月別注釈表示用スタイル */
.monthly-notes {
    margin-left: 15px;
    align-self: center;
}

.monthly-notes-content {
    font-size: 12px;
    color: #333;
}

/* モバイル版月別注釈表示用スタイル */
.mobile-monthly-notes {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.mobile-monthly-notes-content {
    font-size: 12px;
    color: #333;
    line-height: 1.6;
}

.monthly-notes-label {
    font-weight: bold;
    margin-right: 5px;
}

.monthly-note-item {
    word-break: break-word;
}

/* 医師名ボタンスタイル */
.doctor-button {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 3px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.doctor-button:hover {
    background-color: #1e7e34;
    color: white;
    text-decoration: none;
}

/* モバイル版月別注釈スタイル */
@media (max-width: 767px) {
    .monthly-notes {
        display: none;
    }
    
    .mobile-monthly-notes {
        display: block;
    }
    
    .mobile-monthly-notes-content {
        font-size: 11px;
    }
    
    .doctor-button {
        padding: 3px 10px;
        margin: 0 2px;
        font-size: 12px;
    }
}

/* スケジュール注意事項スタイル */
.schedule-notices {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.notice-item {
    margin-bottom: 15px;
}

.notice-item:last-child {
    margin-bottom: 0;
}

.notice-text {
    font-size: 12px;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* モバイル版注意事項スタイル */
@media (max-width: 767px) {
    .schedule-notices {
        margin-top: 15px;
        padding: 10px;
    }
    
    .notice-item {
        margin-bottom: 10px;
    }
    
    .notice-text {
        font-size: 11px;
        line-height: 1.5;
    }
} 