.monthly-schedule-display {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.schedule-title {
    text-align: center;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    flex: 1;
}

/* ナビゲーション */
.schedule-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.schedule-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.schedule-nav-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.schedule-nav-btn .nav-arrow {
    font-size: 12px;
}

.schedule-content {
    margin-top: 10px;
}

.schedule-grid-container {
    overflow: auto;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #fff;
    max-height: 70vh;
    position: relative;
}

.schedule-grid-frontend {
    display: table;
    border-collapse: collapse;
    min-width: 100%;
}

.grid-header {
    display: table-row;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
}

.grid-row {
    display: table-row;
}

.grid-cell {
    display: table-cell;
    border: 1px solid #666;
    text-align: center;
    vertical-align: middle;
    position: relative;
}

.corner-cell {
    background: #2c3e50;
    color: #fff;
    font-weight: 700;
    padding: 12px;
    min-width: 100px;
    border: none;
    position: sticky;
    left: 0;
    z-index: 30;
}

.header-cell.time-cell {
    background: #34495e;
    color: #fff;
    font-weight: 600;
    padding: 12px 5px;
    min-width: 35px;
    font-size: 11px;
    border: none;
    border-left: 1px solid #2c3e50;
}

.day-cell {
    background: #ecf0f1;
    font-weight: 700;
    padding: 12px 10px;
    min-width: 100px;
    font-size: 13px;
    color: #2c3e50;
    border-top: 1px solid #bdc3c7;
    position: sticky;
    left: 0;
    z-index: 10;
    white-space: nowrap;
}

.day-cell.sunday {
    background: #ffebee;
    color: #c62828;
}

.day-cell.saturday {
    background: #e3f2fd;
    color: #1565c0;
}

.day-cell.holiday {
    background: #ffcdd2;
    color: #c62828;
    font-weight: 700;
}

.time-slot {
    min-width: 35px !important;
    width: 35px !important;
    height: 45px;
    background: #fff;
    padding: 0 !important;
    position: relative !important;
    overflow: visible !important;
}

.time-slot:nth-child(odd) {
    background: #fafafa;
}

.schedule-bar {
    position: absolute !important;
    top: 4px !important;
    left: 3px !important;
    height: 37px !important;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1;
    pointer-events: none;
    /* width は PHP で動的に設定 (例: width: 300% = 3セル分) */
}

.schedule-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .schedule-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .schedule-nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .schedule-title {
        font-size: 18px;
        order: -1;
    }
    
    .day-cell {
        min-width: 80px;
        padding: 8px 5px;
        font-size: 11px;
    }
    
    .corner-cell {
        min-width: 80px;
        padding: 8px 5px;
        font-size: 10px;
    }
    
    .header-cell.time-cell {
        min-width: 25px;
        width: 25px;
        font-size: 10px;
        padding: 8px 2px;
    }
    
    .time-slot {
        min-width: 25px;
        width: 25px;
        height: 35px;
        position: relative;
    }
    
    .schedule-bar {
        top: 3px !important;
        height: 29px !important;
    }
}

@media (max-width: 480px) {
    .schedule-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .day-cell {
        min-width: 70px;
        padding: 6px 3px;
        font-size: 10px;
    }
    
    .corner-cell {
        min-width: 70px;
        padding: 6px 3px;
        font-size: 9px;
    }
    
    .header-cell.time-cell {
        min-width: 20px;
        width: 20px;
        font-size: 9px;
        padding: 6px 1px;
    }
    
    .time-slot {
        min-width: 20px;
        width: 20px;
        height: 30px;
        position: relative;
    }
    
    .schedule-bar {
        top: 3px !important;
        height: 24px !important;
    }
}

@media (max-width: 360px) {
    .time-slot {
        min-width: 18px;
        width: 18px;
        height: 28px;
        position: relative;
    }
    
    .schedule-bar {
        top: 3px !important;
        left: 2px !important;
        height: 22px !important;
        border-radius: 3px;
    }
    
    .day-cell {
        min-width: 65px;
        padding: 5px 2px;
        font-size: 9px;
    }
    
    .corner-cell {
        min-width: 65px;
        padding: 5px 2px;
        font-size: 8px;
    }
    
    .header-cell.time-cell {
        min-width: 18px;
        width: 18px;
        font-size: 8px;
        padding: 5px 1px;
    }
}
